/* ==========================================================================
   English Learn — 现代化 UI 样式
   保持原有 WeChat 聊天式交互，整体大幅美化
   ========================================================================== */

:root {
    --green: #07c160;
    --green-dark: #06ad56;
    --green-bubble: #95ec69;
    --ink: #1f2329;
    --muted: #8a8f99;
    --line: #eceef1;
    --panel: #ffffff;
    --chat-bg: #f4f6f8;
    --radius: 22px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --ring: rgba(7, 193, 96, 0.35);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-touch-callout: none;
    touch-action: pan-y;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI",
        "Helvetica Neue", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--ink);
    overscroll-behavior-y: none;
    background:
        radial-gradient(1100px 560px at 18% -12%, rgba(56, 189, 248, 0.28), transparent 60%),
        radial-gradient(900px 520px at 104% 8%, rgba(129, 140, 248, 0.28), transparent 58%),
        linear-gradient(160deg, #0b1220 0%, #1c2536 52%, #16204a 100%);
    background-attachment: fixed;
}

/* ==========================================================================
   手机框容器
   ========================================================================== */
.phone-frame {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 100vh;
    max-height: 92vh;
    margin: auto;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

/* 电脑端（横屏） */
@media (min-aspect-ratio: 1/1) {
    .phone-frame {
        height: 92vh;
        border-radius: 28px;
    }
}

/* 手机端（竖屏）全屏 */
@media (max-aspect-ratio: 1/1) {
    .phone-frame {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
}

/* ==========================================================================
   顶部栏
   ========================================================================== */
.header {
    flex-shrink: 0;
    padding: 14px 12px;
    background: linear-gradient(135deg, #08c968 0%, #06a851 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 18px rgba(6, 168, 81, 0.28);
    position: relative;
    z-index: 5;
}

.header-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    line-height: 1.25;
}

.header-cat {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    margin-bottom: 3px;
    white-space: nowrap;
}

.header-title {
    font-size: 15px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-pos {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 1px;
}

.study-today {
    font-size: 10px;
    opacity: 0.75;
    margin-top: 1px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 图标按钮（导航 / 打印 / 设置） */
.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.icon-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.icon-btn:active:not(:disabled) {
    transform: scale(0.92);
}

.icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.icon-btn .arrow {
    font-size: 22px;
    font-weight: 500;
    margin-top: -2px;
}

/* ==========================================================================
   分类切换 Tab
   ========================================================================== */
.category-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.category-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    background: #f0f2f5;
    transition: all 0.2s;
}

.category-tab.active {
    background: linear-gradient(135deg, #08c968, #06a851);
    color: #fff;
    box-shadow: 0 4px 12px var(--ring);
}

/* ==========================================================================
   聊天区域
   ========================================================================== */
.chat-container {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 16px 12px 28px;
    background:
        radial-gradient(100% 100% at 50% 0%, #fbfcfe 0%, var(--chat-bg) 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.16) transparent;
    display: flex;
    flex-direction: column;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.16);
    border-radius: 6px;
}

/* 消息容器 */
.message-wrap {
    max-width: 82%;
    margin: 7px 0;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: slideIn 0.32s ease-out both;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-wrap.left {
    align-self: flex-start;
}

.message-wrap.right {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* 头像 */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
    border: 2px solid #fff;
    cursor: pointer;
    transition: transform 0.18s;
}

.avatar:active {
    transform: scale(0.9);
}

.message-wrap.left .avatar {
    background-image: url("/static/images/yx.jpg");
}

.message-wrap.right .avatar {
    background-image: url("/static/images/am.jpg");
}

/* 气泡 */
.message {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
    max-width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
}

.message-wrap.left .message {
    background: #ffffff;
    border: 1px solid #e9ecf0;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
    color: #26303c;
}

.message-wrap.right .message {
    background: var(--green-bubble);
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.18);
    color: #17240d;
}

/* 文本 */
.message .text {
    display: block;
    color: inherit;
}

.cn-text {
    display: none;
    color: #8a8f99;
}

/* 设置开启「中英文同时显示」时的样式（参考打印布局） */
.chat-container.show-both .cn-text {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.18);
    color: #7b828c;
    font-size: 0.94em;
}

/* ==========================================================================
   目录 / 收藏 页面
   ========================================================================== */
.page-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 32px;
    background: var(--chat-bg);
}

.directory-section {
    margin-bottom: 22px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin: 4px 2px 12px;
}

.section-title::before {
    content: "";
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: linear-gradient(180deg, #08c968, #06a851);
}

.section-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 9px;
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border-bottom: 1px solid var(--line);
}

.file-item:last-child {
    border-bottom: none;
}

.file-link {
    flex: 1;
    display: block;
    padding: 14px 14px;
    text-decoration: none;
    color: #303946;
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.15s;
}

.file-link:hover {
    background: #f6f8fa;
}

.file-link:active {
    background: #eef1f5;
}

.fav-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #06a851;
    background: rgba(7, 193, 96, 0.12);
    border-radius: 6px;
    padding: 1px 7px;
    margin-right: 8px;
    vertical-align: 1px;
}

.favorite-btn {
    width: 26px;
    height: 26px;
    margin-right: 14px;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    background: url("/static/favorite.jpg") no-repeat center;
    background-size: contain;
    border-radius: 8px;
    padding: 0;
    filter: grayscale(100%) opacity(0.45);
    transition: filter 0.2s, transform 0.2s;
}

.favorite-btn.active {
    filter: none;
}

.favorite-btn:active {
    transform: scale(0.85);
}

.empty-tip {
    text-align: center;
    color: var(--muted);
    padding: 60px 20px;
    font-size: 14px;
}

/* ==========================================================================
   设置弹层
   ========================================================================== */
.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    z-index: 200;
}

.settings-overlay.open {
    opacity: 1;
    visibility: visible;
}

.settings-sheet {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 8px 20px 28px;
    max-height: 86vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}

.settings-overlay.open .settings-sheet {
    transform: translateY(0);
}

.settings-handle {
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: #e2e5e9;
    margin: 8px auto 14px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.settings-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.settings-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f0f2f5;
    color: #5b6470;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 2px;
}

.setting-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.setting-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* iOS 风格开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d6d9de;
    border-radius: 999px;
    transition: background 0.25s;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 26px;
    width: 26px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s;
}

.switch input:checked + .slider {
    background: var(--green);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

/* 语音后台下载按钮 */
.download-btn {
    flex-shrink: 0;
    min-width: 64px;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: #f0f2f5;
    color: #303946;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn:active {
    transform: scale(0.94);
}

.download-btn.running {
    background: #ff3b30;
    color: #fff;
}

/* ==========================================================================
   交互反馈动画
   ========================================================================== */
.error-pulse {
    animation: errorPulse 0.5s;
}

@keyframes errorPulse {
    0% { background: inherit; }
    50% { background: rgba(255, 59, 48, 0.14); }
    100% { background: inherit; }
}

.favorite-animation {
    animation: favoritePulse 0.5s;
}

@keyframes favoritePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   响应式微调
   ========================================================================== */
@media (max-width: 480px) {
    .header-title {
        font-size: 14px;
    }
    .message {
        font-size: 16px;
        line-height: 1.55;
    }
    .avatar {
        width: 40px;
        height: 40px;
    }
}

/* 禁用 iOS 双击缩放 / 长按菜单 */
@media (pointer: coarse) {
    * {
        touch-action: pan-y;
    }
}

/* ==========================================================================
   长按菜单 / 底部操作栏 / 设置扩展 / 登录页
   ========================================================================== */
.context-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(10, 15, 25, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.context-overlay.open {
    opacity: 1;
    visibility: visible;
}

.context-sheet {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}

.context-overlay.open .context-sheet {
    transform: translateY(0);
}

.context-handle {
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: #e2e5e9;
    margin: 8px auto 10px;
}

.context-item {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px 0;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--ink);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.context-item:active {
    background: #f0f2f5;
}

.context-item.cancel {
    margin-top: 6px;
    background: #f2f2f7;
    color: #5b6470;
    font-weight: 600;
}

.context-item.cancel:active {
    background: #e7eaee;
}

/* 底部操作栏 */
.bottom-actions {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--line);
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 0;
    border: 1px solid #e4e7eb;
    border-radius: 14px;
    background: #f7f8fa;
    color: #4b5560;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.action-btn .action-icon {
    font-size: 15px;
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn.learned.active {
    background: rgba(7, 193, 96, 0.14);
    border-color: var(--green);
    color: #06a851;
}

.action-btn.focus.active {
    background: rgba(255, 159, 10, 0.14);
    border-color: #ff9f0a;
    color: #e08800;
}

/* 学习目录下拉 */
.dir-select {
    flex-shrink: 0;
    padding: 9px 12px;
    border: 1px solid #e4e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    outline: none;
}

.dir-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--ring);
}

/* 设置里的标记列表 */
.settings-group-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin: 14px 2px 4px;
}

.mark-list {
    max-height: 168px;
    overflow-y: auto;
    background: #f7f8fa;
    border-radius: 12px;
    padding: 4px;
}

.mark-empty {
    text-align: center;
    color: #b6bcc4;
    font-size: 12px;
    padding: 12px 0;
}

.mark-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
}

.mark-item:active {
    background: #eef1f5;
}

.mark-link {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #303946;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mark-cat {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #06a851;
    background: rgba(7, 193, 96, 0.12);
    border-radius: 6px;
    padding: 1px 6px;
}

.mark-remove {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #e4e7eb;
    color: #7b828c;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.mark-remove:active {
    background: #ffd6d4;
    color: #ff3b30;
}

/* 轻提示 */
#toast {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translateX(-50%) translateY(10px);
    background: rgba(20, 24, 30, 0.88);
    color: #fff;
    font-size: 13px;
    padding: 9px 18px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 400;
}

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

/* 目录「已学」徽标 */
.studied-badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: #06a851;
    background: rgba(7, 193, 96, 0.12);
    border-radius: 6px;
    padding: 2px 7px;
    margin-right: 4px;
}

/* 激励语（低调不抢镜） */
.motivate {
    text-align: center;
    color: #a6adb6;
    font-size: 12px;
    margin: 2px 0 16px;
    letter-spacing: 0.02em;
}

.chat-end {
    text-align: center;
    color: #b6bcc4;
    font-size: 12px;
    margin: 18px 0 4px;
}

/* ==========================================================================
   登录页
   ========================================================================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 340px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    padding: 48px 28px 36px;
    text-align: center;
    animation: loginIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes loginIn {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 22px;
    background: linear-gradient(160deg, #34d17b 0%, #07c160 55%, #059a4e 100%);
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 34px rgba(7, 193, 96, 0.32);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.login-subtitle {
    font-size: 14px;
    color: #9aa0a6;
    margin: 8px 0 34px;
}

.login-input {
    width: 100%;
    padding: 15px 18px;
    border: none;
    border-radius: 14px;
    background: #f2f2f7;
    font-size: 16px;
    text-align: center;
    color: var(--ink);
    outline: none;
    transition: box-shadow 0.2s, background 0.2s;
}

.login-input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.28);
}

.login-input::placeholder {
    color: #b0b5bd;
}

.login-btn {
    width: 100%;
    margin-top: 18px;
    padding: 15px 0;
    border: none;
    border-radius: 14px;
    background: #07c160;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.2s;
}

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

.login-btn:disabled {
    opacity: 0.6;
}

.shake {
    animation: shake 0.45s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* ==========================================================================
   目录页：搜索框 / 今日一句 / 随机
   ========================================================================== */
.search-box {
    display: flex;
    gap: 8px;
    margin: 2px 0 12px;
}

.search-box input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid #e4e7eb;
    border-radius: 12px;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.search-box input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--ring);
}

.search-box button {
    flex-shrink: 0;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #08c968, #06a851);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.daily-card {
    position: relative;
    background: linear-gradient(135deg, #eafff2 0%, #f4fff8 100%);
    border: 1px solid #d5f5e1;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.daily-label {
    font-size: 11px;
    font-weight: 700;
    color: #06a851;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.daily-en {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.4;
}

.daily-cn {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.daily-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #06a851;
    text-decoration: none;
}

.random-btn {
    display: block;
    width: 100%;
    padding: 11px 0;
    margin-bottom: 18px;
    border: 1px dashed #b9d8c8;
    border-radius: 14px;
    background: #f7fbf9;
    color: #1f7a4d;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.random-btn:active {
    background: #e9f6ef;
}

/* ==========================================================================
   生词本
   ========================================================================== */
.vocab-add {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.vocab-input {
    flex: 1;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #e4e7eb;
    border-radius: 12px;
    font-size: 14px;
    color: var(--ink);
    outline: none;
}

.vocab-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--ring);
}

.vocab-add-btn {
    flex-shrink: 0;
    padding: 0 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #08c968, #06a851);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.vocab-list {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.vocab-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

.vocab-item:last-child {
    border-bottom: none;
}

.vocab-text {
    flex: 1;
    min-width: 0;
}

.vocab-en {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.vocab-cn {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

/* ==========================================================================
   统计页
   ========================================================================== */
.stats-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.stats-row {
    display: flex;
    text-align: center;
}

.stat-block {
    flex: 1;
}

.stat-num {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}

.stat-label {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.checkin-btn {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 11px 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #08c968, #06a851);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.checkin-btn.done {
    background: #e7eaee;
    color: #9aa1ab;
}

.stats-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 10px;
}

.cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cal-nav {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #eef1f5;
    color: #1f2937;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-week {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    padding: 2px 0 4px;
}

.cal-cell {
    position: relative;
    min-height: 46px;
    border-radius: 9px;
    background: #f2f4f7;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 12px;
    color: #4b5560;
    text-decoration: none;
    cursor: pointer;
}

.cal-cell.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.cal-day {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #4b5560;
}

.cal-cell.on {
    background: #e9f9f0;
    border-color: #bfe8d2;
}

.cal-cell.on .cal-day {
    color: #06a851;
}

.cal-cell.today {
    border-color: #08c968;
    box-shadow: 0 0 0 2px rgba(8, 201, 104, 0.28);
}

.cal-check {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #08c968;
}

.cal-study {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    color: #2563eb;      /* 蓝色：>= 10 分钟 */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-study.low {
    color: #e5484d;      /* 红色：< 10 分钟 */
}

.duration-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.duration-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: #4b5560;
}

.duration-item b {
    color: #1f2937;
    font-weight: 700;
}

.review-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
    text-decoration: none;
    color: #4b5560;
    font-size: 14px;
}

.review-entry b {
    color: #e08800;
}

.share-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    margin-top: 12px;
    background: linear-gradient(135deg, #08c968, #06a851);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(6, 168, 81, 0.28);
    text-decoration: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.share-entry b {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

/* ==========================================================================
   搜索页
   ========================================================================== */
.search-count {
    font-size: 12px;
    color: var(--muted);
    margin: 2px 2px 10px;
}

.search-item .file-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-en {
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.search-cn {
    font-size: 13px;
    color: #6b7280;
}

/* ==========================================================================
   复习页
   ========================================================================== */
.review-done-btn {
    flex-shrink: 0;
    margin-right: 12px;
    padding: 6px 12px;
    border: none;
    border-radius: 999px;
    background: rgba(7, 193, 96, 0.12);
    color: #06a851;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.review-done-btn:active {
    background: rgba(7, 193, 96, 0.22);
}

.review-due {
    flex-shrink: 0;
    margin-right: 12px;
    font-size: 12px;
    color: var(--muted);
}

/* ==========================================================================
   打卡分享页
   ========================================================================== */
#card {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.18);
    margin-bottom: 18px;
}

.share-section {
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.share-label {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.theme-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-swatch {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    transition: transform 0.12s ease;
}

.theme-swatch.active {
    transform: scale(1.12);
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px #06a851;
}

.share-toggles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    font-size: 14px;
    color: #4b5560;
    cursor: pointer;
}

.share-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #06a851;
    cursor: pointer;
}

.share-download {
    display: block;
    width: 100%;
    padding: 14px 0;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #08c968, #06a851);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(6, 168, 81, 0.28);
    margin-bottom: 10px;
}

.share-tip {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
}

/* ==========================================================================
   使用说明页
   ========================================================================== */
.about-hero {
    text-align: center;
    padding: 26px 16px 24px;
    margin-bottom: 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #08c968, #05b8a0, #0489b1);
    box-shadow: 0 6px 20px rgba(6, 168, 81, 0.25);
}

.about-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.about-title {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
}

.about-sub {
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.feature-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0fdf4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
}

.feature-text b {
    font-size: 14px;
    color: #1f2937;
}

.feature-text span {
    font-size: 12px;
    color: #6b7280;
}

.about-steps {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: #4b5560;
    line-height: 1.5;
}

.about-steps b {
    color: #1f2937;
}

.about-footer {
    text-align: center;
    padding: 18px 0 10px;
    font-size: 13px;
    color: var(--muted);
}

/* ==========================================================================
   主页卡片
   ========================================================================== */
.home-stats {
    display: flex;
    background: #fff;
    border-radius: 16px;
    padding: 14px 8px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.home-stat {
    flex: 1;
    text-align: center;
}

.home-stat b {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.home-stat span {
    font-size: 11px;
    color: var(--muted);
}

.resume-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #08c968, #06a851);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(6, 168, 81, 0.28);
}

.resume-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.resume-text {
    flex: 1;
    min-width: 0;
}

.resume-label {
    font-size: 12px;
    opacity: 0.85;
}

.resume-title {
    font-size: 15px;
    font-weight: 700;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resume-arrow {
    font-size: 26px;
    opacity: 0.85;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.home-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border-radius: 16px;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.home-card:active {
    transform: scale(0.98);
}

.home-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.home-card-name {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.home-card-desc {
    font-size: 11px;
    color: var(--muted);
}

.settings-page {
    background: #fff;
    border-radius: 16px;
    padding: 8px 16px 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   全局隐藏滚动条
   ========================================================================== */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
* {
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE / Edge */
}

/* ==========================================================================
   重置按钮
   ========================================================================== */
.reset-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 0;
    border: 1px solid #f3c2c7;
    border-radius: 12px;
    background: #fff5f6;
    color: #e5484d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.reset-btn:active {
    background: #ffe9ec;
}

/* ==========================================================================
   日详情：0-24 小时学习时间线（GitHub 风格热力图）
   ========================================================================== */
.day-hero {
    background: linear-gradient(135deg, #08c968, #06a851);
    border-radius: 16px;
    padding: 20px 16px;
    margin-bottom: 14px;
    color: #fff;
    text-align: center;
    box-shadow: 0 4px 16px rgba(6, 168, 81, 0.28);
}

.day-hero-label {
    font-size: 12px;
    opacity: 0.85;
}

.day-hero-value {
    font-size: 32px;
    font-weight: 800;
    margin: 6px 0 2px;
}

.day-hero-sub {
    font-size: 12px;
    opacity: 0.85;
}

.heat-legend {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--muted);
}

.heat-legend i {
    width: 13px;
    height: 13px;
    border-radius: 3px;
    display: inline-block;
}

.heat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.heat-cell {
    min-height: 46px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 2px;
}

.heat-hour {
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.heat-val {
    font-size: 9px;
    font-weight: 600;
    line-height: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* GitHub 风格热力色阶 */
.heat-0 { background: #ebedf0; color: #8a8f99; }
.heat-1 { background: #9be9a8; color: #1a7f37; }
.heat-2 { background: #40c463; color: #ffffff; }
.heat-3 { background: #30a14e; color: #ffffff; }
.heat-4 { background: #216e39; color: #ffffff; }

.hour-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hour-chip {
    background: #eef6ff;
    color: #2563eb;
    border: 1px solid #dbe7ff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
}
