* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* 涓婚〉闈㈡牱寮?*/
.home-page {
    background: linear-gradient(145deg, #e9f0f9 0%, #dee8f2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.dashboard {
    max-width: 1100px;
    width: 100%;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(4px);
    border-radius: 3rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 40px -12px rgba(20,45,70,0.3);
}

.header {
    text-align: center;
    margin-bottom: 1rem;
}

.header h1 {
    font-size: 2.4rem;
    font-weight: 600;
    background: linear-gradient(135deg, #1B3B4F, #2C5A73);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 1;
    margin: 0 auto;
    width: fit-content;
}

.header-icon {
    width: 18rem;
    height: 18rem;
    object-fit: contain;
    object-position: top center;
    display: block;
    margin-bottom: -10rem;
}

.header-title-text {
    display: block;
    text-align: center;
    margin: -3rem 0 0.5rem 0;
    padding: 0;
    line-height: 1.05;
}

.header p {
    color: #2F5575;
    font-size: 1.2rem;
    margin: -10rem 0 0 0;
    font-weight: 400;
    border-bottom: 1px dashed #9bb6d0;
    display: block;
    padding: 0 0 0.35rem;
}

/* 缃戞牸甯冨眬锛氬叚涓懆妯″潡锛堟柟褰級 */
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    justify-content: center;
    margin: 0 auto;
}

.week-tile {
    aspect-ratio: 1 / 1;
    min-width: 0;
    background: white;
    border-radius: 2.2rem;
    box-shadow: 0 12px 28px -8px rgba(26, 58, 90, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    color: #1F3A58;
    font-weight: 500;
    user-select: none;
}

.week-tile:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 38px -10px #1a405f;
    border-color: #ffffff;
    background: rgba(255,255,255,1);
}

.week-icon {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(2px 4px 6px rgba(20,60,90,0.15));
}

.week-title {
    font-size: 1.6rem;
    font-weight: 650;
    background: linear-gradient(140deg, #1d3f5e, #2b5780);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    word-break: break-word;
}

.week-sub {
    font-size: 1rem;
    color: #3e6285;
    margin-top: 0.3rem;
}

.week-1 { background: #eef4fc; }
.week-2 { background: #f0f1fe; }
.week-3 { background: #e9f6f0; }
.week-4 { background: #fef3ea; }
.week-5 { background: #fdedf4; }
.week-6 { background: #e6f0fa; }

.footer-note {
    margin-top: 2.5rem;
    font-size: 1rem;
    color: #3e5f82;
    text-align: center;
    font-weight: 400;
    background: rgba(255,255,255,0.5);
    padding: 0.7rem 1.5rem;
    border-radius: 40px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    backdrop-filter: blur(4px);
}

/* 姣忔棩妯″潡鍒楄〃寮圭獥锛堢涓€灞傦級 - 鏀逛负椤甸潰褰㈠紡 */
.daily-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #e9f0f9 0%, #dee8f2 100%);
    z-index: 1000;
    overflow-y: auto;
    display: none;
}

.daily-page.active {
    display: block;
}

.daily-page-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.back-btn {
    background: white;
    border: none;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    color: #1e3f5c;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    transition: all 0.2s;
}

.back-btn:hover {
    background: #eef2f9;
    transform: scale(1.05);
}

.page-header h2 {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(145deg, #1B4A6B, #25658b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    background: #f7faff;
    border-radius: 2rem;
    padding: 1.4rem 1.6rem;
    box-shadow: 0 4px 12px #cbd6e6;
    border-left: 6px solid #4f8bb9;
    cursor: pointer;
    transition: all 0.2s;
}

.card:hover {
    transform: translateX(10px);
    background: #ffffff;
    box-shadow: 0 8px 20px #a5bedb;
}

/* 缁冧範椤甸潰锛?-1锛?*/
.practice-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at top, rgba(255,255,255,0.55), transparent 34%),
        linear-gradient(180deg, #f7fbff 0%, #edf4fb 52%, #e9f1f8 100%);
    z-index: 1100;
    overflow: hidden;
    display: none;
}

.practice-page.active {
    display: block;
}

.practice-content {
    max-width: 860px;
    height: 100dvh;
    margin: 0 auto;
    padding: max(env(safe-area-inset-top), 1rem) 1.25rem max(env(safe-area-inset-bottom), 1rem);
    display: flex;
    flex-direction: column;
}

.practice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
    padding: 0.4rem 0 0.7rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(180deg, rgba(247,251,255,0.96) 0%, rgba(247,251,255,0.82) 78%, rgba(247,251,255,0) 100%);
    backdrop-filter: blur(10px);
}

.practice-header-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.practice-header-left .back-btn {
    margin-right: 0;
}

.practice-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f3a52;
    letter-spacing: -0.01em;
    line-height: 1.3;
    background: none;
    -webkit-text-fill-color: initial;
    min-width: 0;
    max-width: 26ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timer {
    background: rgba(33, 72, 101, 0.96);
    color: white;
    padding: 0.5rem 0.95rem;
    border-radius: 999px;
    font-family: monospace;
    font-size: 1rem;
    letter-spacing: 0.08em;
    box-shadow: 0 8px 18px rgba(24, 54, 77, 0.14);
    flex-shrink: 0;
}

/* 鑱婂ぉ涓讳綋 */
.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin: 0;
    padding: 0.5rem 0 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    scrollbar-gutter: stable;
}

/* 宸︿晶AI */
.message-row-left {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    max-width: min(82%, 38rem);
}

.avatar {
    width: 52px;
    height: 52px;
    background: #dfe9f3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 10px 22px rgba(77, 112, 143, 0.18);
    color: #2b4c6e;
    overflow: hidden;
}

.ai-avatar {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0)),
        #dceaf7 url("../images/ai-therapeutic-avatar-v2.png") center/cover no-repeat;
    color: transparent;
}

.bubble-left {
    background: rgba(255,255,255,0.94);
    padding: 0.95rem 1.2rem;
    border-radius: 1.35rem 1.35rem 1.35rem 0.45rem;
    box-shadow: 0 10px 24px rgba(119, 146, 171, 0.16);
    color: #1f3347;
    font-size: 1rem;
    line-height: 1.65;
    max-width: 100%;
    word-break: break-word;
}

/* 鍙充晶鐢ㄦ埛 */
.message-row-right {
    display: flex;
    justify-content: flex-end;
    max-width: min(76%, 34rem);
    margin-left: auto;
}

.bubble-right {
    background: linear-gradient(180deg, #5e89ad 0%, #466f92 100%);
    color: white;
    padding: 0.9rem 1.15rem;
    border-radius: 1.35rem 1.35rem 0.45rem 1.35rem;
    box-shadow: 0 12px 22px rgba(70, 111, 146, 0.2);
    line-height: 1.6;
}

/* 鐗规畩鍗＄墖 */
.special-card {
    background: linear-gradient(180deg, rgba(241,247,253,0.96) 0%, rgba(232,242,251,0.96) 100%);
    border: 1px solid rgba(135, 169, 198, 0.34);
    border-radius: 1.2rem;
    padding: 1rem 1.15rem;
    box-shadow: 0 10px 22px rgba(120, 150, 176, 0.14);
    color: #1c3853;
    margin: 0.2rem 0;
    width: fit-content;
    max-width: min(100%, 38rem);
    line-height: 1.8;
}

.special-card .scene-title {
    text-align: center;
}

.special-card .annotation {
    font-style: italic;
    color: #b5473e;
    font-weight: 600;
}

.dialogue-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: min(100%, 42rem);
    padding: 1rem;
}

.dialogue-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #365978;
}

.dialogue-card-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: min(100%, 31rem);
}

.dialogue-card-row.is-supporter {
    align-self: flex-end;
}

.dialogue-card-row.is-client {
    align-self: flex-start;
}

.dialogue-card-meta {
    font-size: 0.84rem;
    font-weight: 600;
    color: #54718d;
    padding: 0 0.2rem;
}

.dialogue-card-row.is-supporter .dialogue-card-meta {
    text-align: right;
}

.dialogue-card-bubble {
    padding: 0.9rem 1.05rem;
    border-radius: 1.15rem;
    line-height: 1.7;
    font-size: 0.98rem;
    word-break: break-word;
}

.dialogue-card-bubble-left {
    background: rgba(255, 255, 255, 0.9);
    color: #20384c;
    border-radius: 1.15rem 1.15rem 1.15rem 0.45rem;
    box-shadow: 0 8px 18px rgba(123, 151, 176, 0.14);
}

.dialogue-card-bubble-right {
    background: linear-gradient(180deg, #5f87a8 0%, #4d7392 100%);
    color: #ffffff;
    border-radius: 1.15rem 1.15rem 0.45rem 1.15rem;
    box-shadow: 0 10px 20px rgba(77, 115, 146, 0.18);
}

.dialogue-card-bubble-right .annotation {
    color: #ffe08a;
}

.continue-wrapper {
    display: flex;
    justify-content: flex-start;
    margin: 0.1rem 0 0.35rem 3.5rem;
}

.continue-btn {
    background: rgba(225, 237, 248, 0.95);
    border: 1px solid rgba(123, 165, 207, 0.5);
    color: #1e4a72;
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(146, 174, 199, 0.2);
    transition: all 0.2s;
}

.continue-btn:hover {
    background: #c3dafc;
    transform: scale(1.02);
}

.continue-btn.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: default;
}

.wait-skip-btn {
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(123, 165, 207, 0.7);
    color: #345a7d;
    border-radius: 999px;
    padding: 0.32rem 0.9rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(146, 174, 199, 0.18);
}

.wait-skip-btn:hover {
    background: #eef5fd;
}

/* 杈撳叆鍖?*/
.input-area {
    display: flex;
    gap: 0.6rem;
    background: rgba(255,255,255,0.92);
    border-radius: 1.35rem;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    border: 1px solid rgba(160, 190, 217, 0.55);
    align-items: center;
    margin-top: 0.4rem;
    transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 12px 26px rgba(120, 148, 174, 0.16);
    backdrop-filter: blur(12px);
}

.input-area.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: #eef3f9;
}

.input-area input {
    flex: 1;
    border: none;
    padding: 0.8rem 0;
    background: transparent;
    outline: none;
    font-size: 1rem;
    color: #1c3c5c;
}

.input-area input::placeholder {
    color: #6d8aa8;
}

.input-area button {
    background: linear-gradient(180deg, #4f7ca1 0%, #3c6688 100%);
    border: none;
    color: white;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 8px 18px rgba(67, 104, 135, 0.22);
}

.input-area button:hover {
    background: #235f8a;
    transform: scale(1.05);
}

.hint-text {
    color: #516f8d;
    font-size: 0.92rem;
    margin: 0.35rem 0 0.1rem 4rem;
    font-style: italic;
}

/* 鎸夐挳缁勬牱寮?*/
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.85rem 0 0.2rem 4rem;
    justify-content: flex-start;
}

.state-button {
    background: rgba(255,255,255,0.94);
    border: 1px solid rgba(123, 165, 207, 0.65);
    color: #1e4a72;
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    font-size: 0.96rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(160, 186, 211, 0.16);
    transition: all 0.2s;
}

.state-button:hover:not(.disabled) {
    background: #dbeafe;
    transform: scale(1.05);
}

.state-button.disabled {
    opacity: 0.6;
    cursor: default;
    background: #f0f4f8;
}

.state-button.visited {
    background: #c3dafc;
    border-color: #5a8bc9;
}

/* 鍗＄墖杩斿洖鎸夐挳 */
.card-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 0.85rem 0 0.1rem 4rem;
    justify-content: flex-start;
}

.card-btn {
    background: rgba(225, 237, 248, 0.95);
    border: 1px solid rgba(123, 165, 207, 0.65);
    color: #1e4a72;
    border-radius: 999px;
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(160, 186, 211, 0.16);
    transition: all 0.2s;
}

.card-btn:hover {
    background: #c3dafc;
    transform: scale(1.02);
}

.card-btn.primary {
    background: #4f8bb9;
    color: white;
    border-color: #3d6b92;
}

.card-btn.primary:hover {
    background: #3d6b92;
}

/* 鐞嗚В鎸夐挳锛堝凡浜嗚В锛?*/
.understand-btn {
    background: linear-gradient(180deg, #5a88ac 0%, #477496 100%);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 0.78rem 1.3rem;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(95, 132, 165, 0.22);
    transition: all 0.2s;
}

.understand-btn:hover {
    background: #3d6b92;
    transform: scale(1.05);
}

/* 璁℃椂鍣ㄦ牱寮?*/
.card-timer {
    display: inline-block;
    background: rgba(72, 118, 154, 0.88);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    font-weight: bold;
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.card-timer {
    min-width: 9.5rem;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.countdown-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: -0.2rem 0 0.5rem 0;
}

.countdown-wrapper.after-card {
    margin-left: 4rem;
}

.countdown-wrapper.after-message {
    margin-left: 4rem;
}

@media (max-width: 900px) {
    .dashboard {
        padding: 2rem 1.5rem;
        border-radius: 2.5rem;
    }

    .header-icon {
        width: 15rem;
        height: 15rem;
        margin-bottom: -8.5rem;
    }

    .header-title-text {
        margin-top: -2.5rem;
    }

    .header p {
        margin-top: -8.5rem;
    }

    .practice-content {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .practice-header h2 {
        max-width: 20ch;
    }

    .message-row-left,
    .message-row-right,
    .special-card {
        max-width: 88%;
    }
}

@media (max-width: 640px) {
    .home-page {
        padding: max(1rem, env(safe-area-inset-top)) 0.75rem max(1rem, env(safe-area-inset-bottom));
        justify-content: flex-start;
    }

    .dashboard {
        border-radius: 2rem;
        padding: 1.5rem 1rem 1.25rem;
    }

    .header {
        margin-bottom: 1.25rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header-icon {
        width: 11.5rem;
        height: 11.5rem;
        margin-bottom: -6.6rem;
    }

    .header-title-text {
        margin: -1.7rem 0 0.45rem 0;
        line-height: 1.08;
    }

    .header p {
        margin: -5.9rem 0 0 0;
        font-size: 1rem;
        padding-bottom: 0.3rem;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .week-tile {
        border-radius: 1.5rem;
        padding: 1rem 0.75rem;
    }

    .week-icon {
        font-size: 2.25rem;
    }

    .week-title {
        font-size: 1.3rem;
    }

    .week-sub {
        font-size: 0.92rem;
    }

    .footer-note {
        width: 100%;
        margin-top: 1.5rem;
        padding: 0.75rem 1rem;
        font-size: 0.92rem;
        border-radius: 1.2rem;
    }

    .practice-content {
        padding: max(env(safe-area-inset-top), 0.75rem) 0.75rem max(env(safe-area-inset-bottom), 0.75rem);
    }

    .practice-header {
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.55rem;
    }

    .practice-header-left {
        flex: 1;
        gap: 0.7rem;
    }

    .practice-header-left .back-btn {
        width: 2.65rem;
        height: 2.65rem;
        font-size: 1.45rem;
    }

    .practice-header h2 {
        font-size: 1rem;
        max-width: 100%;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .timer {
        padding: 0.45rem 0.75rem;
        font-size: 0.92rem;
    }

    .chat-messages {
        padding-top: 0.25rem;
        gap: 0.8rem;
    }

    .message-row-left,
    .message-row-right,
    .special-card {
        max-width: 100%;
    }

    .dialogue-card {
        width: 100%;
        padding: 0.95rem;
    }

    .dialogue-card-row {
        width: min(100%, 26rem);
    }

    .avatar {
        width: 42px;
        height: 42px;
    }

    .bubble-left,
    .bubble-right {
        padding: 0.85rem 1rem;
        font-size: 0.96rem;
    }

    .continue-wrapper,
    .hint-text,
    .button-group,
    .card-action-buttons,
    .countdown-wrapper.after-card,
    .countdown-wrapper.after-message {
        margin-left: 3rem;
    }

    .input-area {
        gap: 0.45rem;
        padding-left: 0.85rem;
    }

    .input-area input {
        padding: 0.72rem 0;
        font-size: 0.96rem;
    }

    .input-area button {
        width: 2.7rem;
        height: 2.7rem;
    }
}

@media (max-width: 380px) {
    .dashboard {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .grid {
        gap: 0.85rem;
    }

    .week-tile {
        padding: 0.9rem 0.65rem;
    }

    .week-icon {
        font-size: 2rem;
    }

    .week-title {
        font-size: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-btn,
    .continue-btn,
    .input-area,
    .input-area button,
    .state-button,
    .card-btn,
    .understand-btn {
        transition: none;
    }
}
