/* =========================================
   Base
========================================= */
:root {
    --green: #006039;
    --gold: #A37E2C;

    --bg: #f8f7f3;
    --card-bg: rgba(255, 255, 255, 0.94);
    --card-border: rgba(163, 126, 44, 0.16);

    --text-main: #10221a;
    --text-sub: #50625a;

    --shadow-soft:
        0 10px 30px rgba(0, 96, 57, 0.06),
        0 2px 8px rgba(163, 126, 44, 0.06);

    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;

    --panel-gap: 20px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        "SF Pro Display",
        "Hiragino Sans",
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        "Meiryo",
        sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 18% 22%, rgba(163, 126, 44, 0.10) 0, rgba(163, 126, 44, 0.00) 22%),
        radial-gradient(circle at 82% 78%, rgba(0, 96, 57, 0.06) 0, rgba(0, 96, 57, 0.00) 26%),
        linear-gradient(180deg, #fbfaf7 0%, #f7f5ef 100%);
}

/* =========================================
   App Shell
========================================= */
.app-shell {
    padding: 22px;
    min-height: 100vh;
}

.board-layout {
    height: calc(100vh - 44px);
    display: grid;
    grid-template-columns: 240px 280px minmax(0, 1fr);
    gap: var(--panel-gap);
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(4px);
}

/* =========================================
   Left Category Panel
========================================= */
.category-panel {
    padding: 18px;
    overflow: hidden;
    min-height: 0;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
}

.category-list::-webkit-scrollbar {
    width: 8px;
}

.category-list::-webkit-scrollbar-track {
    background: transparent;
}

.category-list::-webkit-scrollbar-thumb {
    background: rgba(0, 96, 57, 0.16);
    border-radius: 999px;
}

.category-item {
    width: 100%;
    min-height: 76px;
    border: 1px solid rgba(0, 96, 57, 0.10);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.category-item.active {
    background: linear-gradient(135deg, #006039 0%, #0a7146 100%);
    color: #fff;
    border-color: rgba(0, 96, 57, 0.5);
    box-shadow:
        0 14px 30px rgba(0, 96, 57, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.category-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-item.active .category-icon svg {
    stroke: #fff;
}

.category-label {
    line-height: 1.3;
}

/* =========================================
   Middle Phrase Panel
========================================= */
.phrase-panel {
    padding: 18px;
    overflow: hidden;
    min-height: 0;
}

.phrase-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
}

.phrase-list::-webkit-scrollbar {
    width: 8px;
}

.phrase-list::-webkit-scrollbar-track {
    background: transparent;
}

.phrase-list::-webkit-scrollbar-thumb {
    background: rgba(0, 96, 57, 0.16);
    border-radius: 999px;
}

.phrase-item {
    position: relative;
    width: 100%;
    min-height: 80px;
    border: 1px solid rgba(0, 96, 57, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-main);
    display: flex;
    align-items: center;
    padding: 0 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    text-align: left;
}

.phrase-item.active {
    background:
        linear-gradient(90deg, rgba(163, 126, 44, 0.20) 0, rgba(163, 126, 44, 0.08) 16%, rgba(255, 255, 255, 0.96) 60%);
    border-color: rgba(163, 126, 44, 0.28);
    box-shadow:
        0 10px 22px rgba(163, 126, 44, 0.10),
        inset 5px 0 0 var(--gold);
    color: var(--gold);
}

.phrase-item-text {
    display: block;
    width: 100%;
    word-break: break-word;
}

/* =========================================
   Right Display Panel
========================================= */
.display-panel {
    padding: 18px;
    display: flex;
    align-items: stretch;
    min-height: 0;
}

.display-inner {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 96, 57, 0.06);
    background:
        radial-gradient(circle at 30% 20%, rgba(163, 126, 44, 0.08), transparent 32%),
        radial-gradient(circle at 75% 75%, rgba(0, 96, 57, 0.05), transparent 34%),
        rgba(255, 255, 255, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 40px;
    text-align: center;
    min-height: 0;
}

.english-text {
    line-height: 1.22;
    font-weight: 700;
    color: var(--green);
    letter-spacing: -0.02em;
    max-width: 92%;
    word-break: break-word;
}

/* 短句：字体大小 */
.english-text.size-large,
.english-text.size-medium,
.english-text.size-small {
    font-size: clamp(34px, 3.2vw, 52px);
    line-height: 1.22;
}

.display-divider {
    width: 110px;
    height: 4px;
    border-radius: 999px;
    background: var(--gold);
    margin-top: 26px;
    opacity: 0.95;
}

/* =========================================
   Responsive
========================================= */

/* iPad 横屏 / 普通笔记本：仍然保持三栏，只是稍微压缩 */
@media (max-width: 1360px) {
    .app-shell {
        padding: 16px;
    }

    .board-layout {
        grid-template-columns: 220px 300px minmax(0, 1fr);
        gap: 14px;
    }

    .category-item {
        min-height: 66px;
        font-size: 16px;
        padding: 0 16px;
    }

    .phrase-item {
        min-height: 68px;
        font-size: 15px;
        padding: 0 18px;
    }

    .display-inner {
        padding: 28px 24px;
    }
}

/* 只有更窄的时候才改成竖排 —— iPad 竖屏 / 手机 */
@media (max-width: 900px) {
    .app-shell {
        padding: 16px;
    }

    .board-layout {
        height: auto;
        min-height: calc(100vh - 32px);
        grid-template-columns: 1fr;
    }

    .category-panel,
    .phrase-panel,
    .display-panel {
        min-height: auto;
    }

    .category-list {
        height: auto;
        max-height: 42vh;
    }

    .phrase-list {
        max-height: 46vh;
        height: auto;
    }

    .display-inner {
        min-height: 240px;
        padding: 28px 22px;
    }

    .english-text.size-large {
        font-size: clamp(30px, 6vw, 42px);
    }

    .english-text.size-medium {
        font-size: clamp(26px, 5.2vw, 36px);
    }

    .english-text.size-small {
        font-size: clamp(22px, 4.6vw, 30px);
    }
}