/* 鈹�鈹� Base Reset & CSS Variables 鈹�鈹� */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-color-fallback: #96C2FF;
    --card-bg: #F0F6FF;
    /* Mobile light blue card */
    --input-bg: #FFFFFF;
    /* Mobile white inputs */
    --border-color: transparent;
    /* Remove border to match mockup */
    --navy-blue: #111A34;
    --light-blue-icon: #EAF3FF;
    --grey-text: #565d65;
    --orange-text: #FF5B35;
    --orange-bg: #FFEFEA;
    --pill-bg: #F0F6FF;
    --pill-text: #4B6188;
    --accent-blue: #3B82F6;
}

html,
body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-color-fallback);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--navy-blue);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 鈹�鈹� Common Card Styling 鈹�鈹� */
.main-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid var(--border-color);
    box-shadow: 0 16px 48px rgba(20, 109, 234, 0.08),
        0 2px 10px rgba(255, 255, 255, 0.5) inset;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.title {
    font-weight: 700;
    color: var(--navy-blue);
    text-align: center;
    letter-spacing: 0.5px;
}

.query-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.query-item {
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 16px rgba(20, 109, 234, 0.04);
    border: 1px solid rgba(20, 109, 234, 0.05);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        background-color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.query-item:nth-child(1) {
    animation-delay: 0.15s;
}

.query-item:nth-child(2) {
    animation-delay: 0.3s;
}

.icon-container {
    border-radius: 12px;
    background: var(--light-blue-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.icon-container img {
    display: block;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.text-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.item-title {
    font-weight: 600;
    color: var(--navy-blue);
    letter-spacing: 0.2px;
    margin-bottom: 5px;
}

.time-pill {
    align-self: flex-start;
    background: var(--pill-bg);
    color: var(--pill-text);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.1px;
}

.status-badge {
    background: var(--orange-bg);
    color: var(--orange-text);
    font-weight: 600;
    border-radius: 100px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.footnote {
    font-size: 12.5px;
    color: var(--grey-text);
    text-align: center;
    letter-spacing: 0.3px;
    font-weight: 400;
    margin-top: auto;
    animation: fadeInUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: 0.45s;
}

/* 鈹�鈹� Mobile Layout (Width <= 768px) 鈹�鈹� */
@media (max-width: 768px) {
    body {
        background-image: url('../../../images/cxindex_1/bg.svg');
        background-position: center bottom;
        align-items: center;
        justify-content: flex-start;
    }

    .app-container {
        width: 100%;
        max-width: 480px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        padding: 40px 12px calc(24px + env(safe-area-inset-bottom)) 12px;
        margin: 0 auto;
    }

    .main-card {
        border-radius: 28px;
        padding: 38px 20px 32px 20px;
        margin-top: 40px;
    }

    .title {
        font-size: 24px;
        margin-bottom: 28px;
    }

    .query-item {
        border-radius: 16px;
        padding: 16px;
    }

    .query-item:active {
        transform: scale(0.96);
        background-color: #F8FBFF;
        box-shadow: 0 2px 8px rgba(20, 109, 234, 0.02);
    }

    .icon-container {
        width: 48px;
        height: 48px;
        margin-right: 14px;
    }

    .icon-container img {
        width: 28px;
        height: 28px;
    }

    .text-info {
        justify-content: center;
    }

    .item-title {
        font-size: 17px;
    }

    .time-pill {
        font-size: 11px;
        padding: 3px 8px;
        border-radius: 6px;
    }

    .status-badge {
        font-size: 12px;
        padding: 4px 10px;
        right: 12px;
        top: 27px;
    }

    .footnote {
        padding-top: 32px;
    }
}

/* 鈹�鈹� PC Desktop Layout (Width > 768px) 鈹�鈹� */
@media (min-width: 769px) {
    body {
        background-image: url('../../../images/cxindex_1/bg.svg');
        background-position: center center;
        align-items: center;
        justify-content: center;
    }

    .app-container {
        width: 100%;
        max-width: 600px;
        /* PC layout width is 600px */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 40px 24px;
        margin: auto 0;
    }

    .main-card {
        border-radius: 32px;
        padding: 44px 36px 36px 36px;
        box-shadow: 0 24px 64px rgba(20, 109, 234, 0.08),
            0 2px 12px rgba(255, 255, 255, 0.6) inset;
    }

    .title {
        font-size: 26px;
        margin-bottom: 32px;
        letter-spacing: 1px;
    }

    .query-item {
        border-radius: 18px;
        padding: 20px 24px;
    }

    /* PC Hover Effects */
    .query-item:hover {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 8px 24px rgba(20, 109, 234, 0.08);
        border-color: rgba(20, 109, 234, 0.2);
        background-color: #F8FBFF;
    }

    .query-item:hover .icon-container {
        background: #E1EFFF;
        transform: scale(1.05);
    }

    .query-item:hover .icon-container img {
        transform: rotate(5deg) scale(1.05);
    }

    .query-item:active {
        transform: translateY(-2px) scale(0.98);
    }

    .icon-container {
        width: 56px;
        height: 56px;
        margin-right: 18px;
    }

    .icon-container img {
        width: 30px;
        height: 30px;
    }

    .text-info {
        align-items: flex-start;
        justify-content: center;
        gap: 6px;
    }

    .item-title {
        font-size: 20px;
        margin-bottom: 4px;
    }

    .time-pill {
        font-size: 14px;
        padding: 4px 10px;
        border-radius: 6px;
    }

    .status-badge {
        font-size: 14px;
        padding: 5px 12px;
        right: 16px;
    }

    .footnote {
        padding-top: 36px;
        font-size: 14px;
    }
}

/* 鈹�鈹� Screen Width Adaptation for iPad / Tablet 鈹�鈹� */
@media (min-width: 769px) and (max-height: 700px) {
    .app-container {
        padding: 20px;
    }

    .main-card {
        padding: 30px 24px 24px 24px;
    }

    .title {
        margin-bottom: 20px;
    }
}

/* 鈹�鈹� Very Small Mobile Adaptation 鈹�鈹� */
@media (max-width: 360px) {
    .app-container {
        padding: 24px 16px 16px 16px;
    }

    .main-card {
        padding: 28px 16px 24px 16px;
        margin-top: 20px;
    }

    .title {
        font-size: 21px;
        margin-bottom: 22px;
    }

    .item-title {
        font-size: 15.5px;
    }

    .icon-container {
        width: 42px;
        height: 42px;
        margin-right: 10px;
    }

    .icon-container img {
        width: 24px;
        height: 24px;
    }
}

/* 鈹�鈹� Core Keyframes & Animations 鈹�鈹� */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wiggle shake for clicked elements */
@keyframes wiggle {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    25% {
        transform: translateY(-50%) translateX(-4px) rotate(-3deg);
    }

    75% {
        transform: translateY(-50%) translateX(4px) rotate(3deg);
    }
}

.wiggle {
    animation: wiggle 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* 鈹�鈹� Custom Interactive Toast Component 鈹�鈹� */
.toast-container {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(17, 26, 52, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 100px;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    width: max-content;
    max-width: 90vw;
    box-sizing: border-box;
}

.toast-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFB020;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
}

/* 鈹�鈹� Query Page CSS Hacks & Styles 鈹�鈹� */
.query-card-top {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px 28px 0 0;
    width: calc(100% - 32px);
    max-width: 480px;
    text-align: center;
    padding: 38px 36px 0 36px;
    font-weight: 700;
    color: var(--navy-blue);
    font-size: 24px;
    box-shadow: 0 16px 48px rgba(20, 109, 234, 0.08), 0 2px 10px rgba(255, 255, 255, 0.5) inset;
    border: 1.5px solid var(--border-color);
    border-bottom: none;
    box-sizing: border-box;
    margin-top: 40px;
}

.query-card-bottom {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0 0 28px 28px;
    width: calc(100% - 32px);
    max-width: 480px;
    padding: 20px 20px 32px 20px;
    border: 1.5px solid var(--border-color);
    border-top: none;
    box-sizing: border-box;
    margin-top: 0;
    margin-bottom: auto;
}

/* Hide empty decorative divs left over from old styles */
.query-card-bottom div:empty {
    display: none !important;
}

/* Reset browser default margin on p elements inside query card to prevent 100px gaps */
.query-card-bottom p {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 15px;
    line-height: normal;
}

/* 鈹�鈹� Form Controls 鈹�鈹� */
.span_mark {
    display: block;
    font-size: 14px;
    color: #333333;
    margin-bottom: 8px;
    margin-top: 8px;
    font-weight: 500;
}

/* Add spacing between input groups */
div+div>.span_mark {
    margin-top: 24px;
}

.query-input {
    width: 100%;
    background-color: var(--input-bg);
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--navy-blue);
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.query-input:focus {
    background-color: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(20, 109, 234, 0.2);
}

.query-btn {
    display: block;
    width: 100%;
    background-color: var(--accent-blue);
    color: #FFFFFF;
    text-align: center;
    border-radius: 24px;
    padding: 14px 0;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 48px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
    cursor: pointer;
}

.query-btn:active {
    transform: scale(0.98);
}

.query-btn:hover {
    background-color: #1059c2;
}

.klk-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

.klk-row .query-input {
    flex: 1;
    text-align: center;
    padding-left: 0;
    padding-right: 0;
}

.klk-row i[id] {
    flex: 1;
    font-style: normal;
    color: var(--navy-blue);
    font-weight: 500;
    white-space: nowrap;
    background-color: var(--input-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.klk-row i:not([id]) {
    display: none !important;
}

/* 鈹�鈹� Result Page Styles 鈹�鈹� */
.inner-white-card {
    background-color: var(--input-bg);
    border-radius: 12px;
    padding: 0 16px;
    margin-bottom: 6px;
    box-shadow: 0 4px 16px rgba(20, 109, 234, 0.04);
    list-style: none;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

table.inner-white-card tbody {
    display: block;
    width: 100%;
}

.inner-white-card li span {
    padding: 8px 0;
}

.inner-white-card li,
.inner-white-card tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #F0F2F5;
}

.inner-white-card li:last-child,
.inner-white-card tr:last-child {
    border-bottom: none;
}

.inner-white-card td {
    padding: 12px 0;
    border: none;
}

.inner-white-card td:first-child,
.inner-white-card li span {
    color: var(--grey-text);
    font-size: 14px;
}

.inner-white-card td:last-child,
.inner-white-card li b {
    color: var(--navy-blue);
    font-weight: 600;
    font-size: 15px;
    text-align: right;
}

.return-btn {
    display: block;
    width: 100%;
    background-color: #d9e9ff;
    color: var(--accent-blue);
    text-align: center;
    border-radius: 24px;
    padding: 14px 0;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 28px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.return-btn:active {
    transform: scale(0.98);
}

.return-btn:hover {
    background-color: #c5ddff;
}

.noResult {
    text-align: center;
    padding: 40px 0;
    color: var(--grey-text);
}

.noResultImg {
    max-width: 150px;
    margin-bottom: 16px;
}

/* 鈹�鈹� PC Adjustments for specific elements 鈹�鈹� */
@media (min-width: 769px) {
    .query-card-top {
        max-width: 600px;
        width: 100%;
        padding: 44px 44px 0 44px;
        font-size: 26px;
        border-radius: 32px 32px 0 0;
        margin-top: auto;
    }

    .query-card-bottom {
        max-width: 600px;
        width: 100%;
        padding: 24px 44px 36px 44px;
        border-radius: 0 0 32px 32px;
        margin-top: 0;
    }

    .query-input {
        height: 50px;
    }

    /* Add spacing between input groups */
    div+div>.span_mark {
        margin-top: 32px;
    }

    .inner-white-card {
        padding-left: 24px;
        padding-right: 24px;
    }

    table.inner-white-card tbody {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 48px;
    }

    table.inner-white-card tr:last-child,
    table.inner-white-card tr:nth-last-child(2):nth-child(odd) {
        border-bottom: none;
    }
}