/* ============================================================
   去AI写作 — 用户端样式（ChatGPT 风格 · 黑白灰 + 圆角 + 双栏布局）
   严格遵循 /DESIGN.md
   章节：
     1. CSS 变量（浅色/深色主题）
     2. 全局基础
     3. 布局壳（sidebar + topbar + main）
     4. 核心组件（composer / btn / card / table / tag / loading）
     5. 表单与通用模块
     6. 页面特殊样式（子导航 / 充值 / 文章详情 / 登录页 等）
     7. 移动端适配
   ============================================================ */

/* ============================================================
   1. CSS 变量
   ============================================================ */
:root {
    /* 背景 */
    --bg-page: #FFFFFF;
    --bg-sidebar: #F9F9F9;
    --bg-input: #F4F4F4;
    --bg-card: #FFFFFF;
    --bg-hover: #F4F4F4;

    /* 文字 */
    --text-primary: #0D0D0D;
    --text-secondary: #6E6E80;
    --text-tertiary: #8E8EA0;

    /* 边框 */
    --border-default: #E5E5E5;
    --border-light: #F0F0F0;

    /* 主按钮 */
    --btn-primary-bg: #0D0D0D;
    --btn-primary-bg-hover: #2A2A2A;
    --btn-primary-text: #FFFFFF;

    /* 语义色（克制使用） */
    --color-success: #10A37F;
    --color-success-bg: #ECFDF5;
    --color-warning: #D97706;
    --color-warning-bg: #FFFBEB;
    --color-danger: #DC2626;
    --color-danger-bg: #FEF2F2;
    --color-info: #2563EB;
    --color-info-bg: #EFF6FF;

    /* 焦点环 */
    --focus-ring: rgba(13, 13, 13, 0.12);

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-focus: 0 0 0 3px var(--focus-ring);

    /* 圆角 */
    --radius-sm: 12px;   /* 按钮/小输入框/tag */
    --radius-md: 16px;   /* 卡片/Modal */
    --radius-lg: 24px;   /* 大输入框 composer */
    --radius-pill: 999px;

    /* 布局尺寸 */
    --sidebar-w: 260px;
    --sidebar-w-collapsed: 60px;
    --topbar-h: 52px;
}

[data-theme="dark"] {
    --bg-page: #212121;
    --bg-sidebar: #171717;
    --bg-input: #2F2F2F;
    --bg-card: #2A2A2A;
    --bg-hover: #2F2F2F;

    --text-primary: #ECECEC;
    --text-secondary: #B4B4B4;
    --text-tertiary: #8E8EA0;

    --border-default: #404040;
    --border-light: #2F2F2F;

    --btn-primary-bg: #FFFFFF;
    --btn-primary-bg-hover: #ECECEC;
    --btn-primary-text: #0D0D0D;

    --color-success-bg: #064E3B;
    --color-warning-bg: #451A03;
    --color-danger-bg: #450A0A;
    --color-info-bg: #1E3A8A;

    --focus-ring: rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ============================================================
   2. 全局基础
   ============================================================ */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue",
        Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    min-height: 100vh;
}
/* 兜底：iOS Safari 加载后偶发整页文字膨胀——把 text-size-adjust 100% 覆盖到所有元素，
   确保深层文本容器也不被自动放大（iPhone8 等小屏） */
body, body * { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

h1 { font-size: 28px; font-weight: 600; margin: 0 0 16px; color: var(--text-primary); }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; color: var(--text-primary); }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--text-primary); }
h4 { font-size: 14px; font-weight: 500; margin: 0 0 6px; color: var(--text-primary); }

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover { color: var(--text-secondary); }

p { margin: 0 0 12px; }

.text-secondary { color: var(--text-secondary); font-size: 14px; }
.text-tertiary  { color: var(--text-tertiary);  font-size: 13px; }

/* 滚动条美化（深色模式更明显） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 4px;
}
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   3. 布局壳（sidebar + topbar + main）
   ============================================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: width 0.2s ease, transform 0.25s ease;
}

.sidebar-header {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.sidebar-logo:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-toggle {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center; justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.sidebar-section {
    padding: 12px 12px 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.sidebar-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-item.active { background: var(--bg-hover); font-weight: 500; }
.sidebar-item .si-icon {
    width: 18px; height: 18px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
}
.sidebar-item .si-label {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis;
}
.sidebar-item .si-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--color-danger);
    flex-shrink: 0;
}
.sidebar-item .si-new {
    flex-shrink: 0;
    display: inline-flex; align-items: center;
    color: var(--text-tertiary);
}
.sidebar-item:hover .si-new { color: var(--text-secondary); }

/* sidebar 历史记录（ChatGPT 聊天历史风格） */
.sidebar-history { margin-top: 2px; }
.sidebar-history-empty {
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.sidebar-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    margin: 1px 0;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-decoration: none;
}
.sidebar-history-item:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.sidebar-history-item.active { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-history-item .h-dot {
    width: 7px; height: 7px; border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-tertiary);
}
.sidebar-history-item .h-dot.s0 { background: var(--text-tertiary); }
.sidebar-history-item .h-dot.s1 { background: var(--color-info); }
.sidebar-history-item .h-dot.s2 { background: var(--color-success); }
.sidebar-history-item .h-dot.s3 { background: var(--color-danger); }
.sidebar-history-item .h-dot.s4 { background: var(--color-warning); }
.sidebar-history-item .h-dot.s5,
.sidebar-history-item .h-dot.s6 { background: var(--text-tertiary); }
.sidebar-history-item .h-dot.s-delayed { background: var(--color-warning); }
.sidebar-history-item .h-title {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis;
}
.sidebar-history-more {
    display: block;
    padding: 7px 10px;
    font-size: 12px;
    color: var(--text-tertiary);
    border-radius: 8px;
    text-decoration: none;
}
.sidebar-history-more:hover { background: var(--bg-hover); color: var(--text-secondary); text-decoration: none; }

/* sidebar 收起时隐藏整个历史区（列表 + 空提示 + 查看全部） */
.sidebar.collapsed .sidebar-history,
.sidebar.collapsed .sidebar-history-empty,
.sidebar.collapsed .sidebar-history-more,
html[data-sidebar="collapsed"] .sidebar-history,
html[data-sidebar="collapsed"] .sidebar-history-empty,
html[data-sidebar="collapsed"] .sidebar-history-more { display: none; }

.sidebar-footer {
    border-top: 1px solid var(--border-light);
    padding: 8px;
    flex-shrink: 0;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}
.sidebar-user:hover { background: var(--bg-hover); }
.sidebar-user .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.sidebar-user .user-meta {
    flex: 1; min-width: 0;
    overflow: hidden;
}
.sidebar-user .user-meta .name {
    font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user .user-meta .points {
    font-size: 12px; color: var(--text-secondary);
}

/* Sidebar 收起状态：只显示图标 */
.sidebar.collapsed {
    width: var(--sidebar-w-collapsed);
}
.sidebar.collapsed .si-label,
.sidebar.collapsed .si-dot,
.sidebar.collapsed .si-new,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .user-meta { display: none; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 8px; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 8px; }

/* ---- 主区域 ---- */
.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.2s ease;
}
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-collapsed); }

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 8px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
}
.topbar-left .chev {
    width: 14px; height: 14px;
    color: var(--text-secondary);
}
.topbar-announcement {
    font-weight: normal;
    font-size: 14px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 46vw;
    display: inline-flex;
    align-items: center;
}
.ann-tag {
    flex-shrink: 0;
    background: var(--color-warning-bg);
    color: var(--color-warning);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-right: 8px;
    font-weight: 500;
}
.topbar-mobile-toggle {
    display: none;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
}
.topbar-mobile-toggle:hover { background: var(--bg-hover); }
.topbar-spacer { flex: 1; }
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn svg { width: 18px; height: 18px; }

.topbar-link {
    padding: 6px 14px;
    color: var(--text-primary);
    font-size: 14px;
    border-radius: var(--radius-pill);
    background: transparent;
    border: none;
    cursor: pointer;
}
.topbar-link:hover { background: var(--bg-hover); color: var(--text-primary); }

.topbar-cta {
    padding: 6px 16px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-radius: var(--radius-pill);
    font-size: 14px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.topbar-cta:hover { background: var(--btn-primary-bg-hover); color: var(--btn-primary-text); }

/* topbar 用户头像（已登录） */
.topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    position: relative;
}
.topbar-avatar:hover { opacity: 0.85; }
.topbar-user-wrap { position: relative; }
.topbar-user-menu {
    position: absolute;
    top: 44px;
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 80;
    display: none;
}
.topbar-user-menu.open { display: block; }
/* 用户下拉菜单（topbar 右上 + sidebar 左下 共用 .menu-info/.menu-item） */
.menu-info {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}
.menu-info .name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
.menu-info .points {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
/* 篇数 / 积分 分两行显示，避免侧栏窄宽时折行错位 */
.sidebar-user .user-meta .points,
.menu-info .points {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}
.sidebar-user .user-meta .points > span,
.menu-info .points > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.menu-item.danger { color: var(--color-danger); }

/* sidebar 底部用户菜单：从底部向上弹出（左下角） */
.sidebar-footer { position: relative; }
.sidebar-user-menu {
    position: absolute;
    bottom: calc(100% - 2px);
    left: 8px;
    right: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 80;
    display: none;
}
.sidebar-user-menu.open { display: block; }
/* sidebar 收起时不弹（避免错位），引导用户先展开 */
.sidebar.collapsed .sidebar-user-menu,
html[data-sidebar="collapsed"] .sidebar-user-menu { display: none !important; }

/* ---- 公告横幅 ---- */
.announcement {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    padding: 10px 16px;
    text-align: center;
    position: relative;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}
.announcement .close-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-warning);
}

/* ---- 主内容区 ---- */
.content {
    flex: 1;
    padding: 24px;
    padding-bottom: 96px;
}
.content-inner {
    margin: 0 auto;
    max-width: 900px;   /* 默认（首页输入框 / 单栏卡片：充值·卡密·设置） */
    width: 100%;
}
.content-inner.wide { max-width: 1100px; }      /* 中等宽度（保留兼容） */
.content-inner.full { max-width: 1600px; }      /* 接近全宽：我的文章表格 / 文章详情双栏 */

/* ---- 移动端 sidebar 遮罩 ---- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 55;
}
.sidebar-backdrop.open { display: block; }

/* ============================================================
   4. 核心组件
   ============================================================ */

/* ---- 强度按钮组（10 档数字，多页面共用） ---- */
.strength-pills {
    display: inline-flex;
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-pill);
    padding: 3px;
    gap: 2px;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.strength-pills::-webkit-scrollbar { display: none; }
.strength-pill {
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}
.strength-pill:hover { color: var(--text-primary); }
.strength-pill.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-weight: 500;
}
/* 当前强度（文章已用的那一档）：主色标识，始终固定在该档 */
.strength-pill.current {
    color: var(--btn-primary-bg);
    box-shadow: inset 0 0 0 1px var(--btn-primary-bg);
}
.strength-pill.active.current {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: none;
}

/* ---- 按钮（只有 2 种主样式 + 状态色） ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
    line-height: 1.4;
    text-decoration: none;
}
.btn:hover {
    background: var(--btn-primary-bg-hover);
    color: var(--btn-primary-text);
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: var(--bg-page);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-success { background: var(--color-success); color: #fff; border-color: transparent; }
.btn-success:hover { background: var(--color-success); color: #fff; opacity: 0.9; }
.btn-danger  { background: var(--color-danger);  color: #fff; border-color: transparent; }
.btn-danger:hover  { background: var(--color-danger); color: #fff; opacity: 0.9; }
.btn-warning { background: var(--color-warning); color: #fff; border-color: transparent; }
.btn-warning:hover { background: var(--color-warning); color: #fff; opacity: 0.9; }

.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn-pill { border-radius: var(--radius-pill); }
.btn-block { display: flex; width: 100%; }
.btn-link {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}
.btn-link:hover { color: var(--text-secondary); }

/* ---- 卡片 ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}
.card.flat {
    box-shadow: none;
    border: 1px solid var(--border-light);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.card-meta {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ---- 表格 ---- */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}
.table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    color: var(--text-primary);
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- 状态标签（7 种） ---- */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}
.tag-pending     { background: var(--bg-hover);         color: var(--text-secondary); }
.tag-processing  { background: var(--color-info-bg);    color: var(--color-info); }
.tag-done        { background: var(--color-success-bg); color: var(--color-success); }
.tag-failed      { background: var(--color-danger-bg);  color: var(--color-danger); }
.tag-reviewing   { background: var(--color-warning-bg); color: var(--color-warning); }
.tag-refunded    { background: var(--bg-hover);         color: var(--text-tertiary); }
.tag-cancelled   { background: var(--bg-hover);         color: var(--text-tertiary); }
.tag-delayed     { background: var(--color-warning-bg); color: var(--color-warning); }

/* ---- Loading 三点脉冲 ---- */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}
.loading-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: dot-pulse 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes dot-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* ============================================================
   5. 表单与通用模块
   ============================================================ */

.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control::placeholder { color: var(--text-tertiary); }
.form-control:focus::placeholder { opacity: 0; }
.form-control:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: var(--shadow-focus);
}
textarea.form-control {
    min-height: 180px;
    resize: vertical;
    line-height: 1.7;
}

.input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.input-row .form-control { flex: 1; min-width: 0; }

/* alert 信息条 */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}
.alert-info    { background: var(--color-info-bg);    color: var(--color-info); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.alert-error   { background: var(--color-danger-bg);  color: var(--color-danger); }

/* 首页提交提示：始终预留一行高度的占位（平时透明），出现/消失不推动下方布局，消除抖动 */
#submit-alert {
    min-height: calc(1.6em + 24px);   /* 一行文字(line-height 1.6) + 上下 padding 12px*2 */
    box-sizing: border-box;
    transition: opacity .15s ease;
}
#submit-alert.is-empty {
    background: transparent;
    opacity: 0;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 16px;
}
.pagination .btn {
    min-width: 36px;
    padding: 6px 10px;
    font-size: 13px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 0.2s ease;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center; justify-content: center;
}
.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.modal-body {
    padding: 16px 24px 24px;
}
.modal-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 20px;
}

/* 居中确认框（替换原生 confirm，PC/移动端都居中） */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.confirm-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-width: 380px;
    width: 100%;
    padding: 24px;
    animation: modal-in 0.18s ease;
}
.confirm-title { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--text-primary); }
.confirm-msg { font-size: 14px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* toast 轻提示（屏幕中央上方，自动消失，不阻塞操作） */
.toast {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -10px);
    z-index: 300;
    max-width: 80vw;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-success { background: var(--color-success); color: #fff; }
.toast-error   { background: var(--color-danger);  color: #fff; }
.toast-info    { background: var(--btn-primary-bg); color: var(--btn-primary-text); }

/* 签到 */
.checkin-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.checkin-info { display: flex; flex-direction: column; gap: 4px; }
.checkin-info .ci-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.checkin-info .ci-sub { font-size: 13px; color: var(--text-secondary); }
.checkin-done {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--color-success); font-weight: 500;
}
/* 卡密兑换表单居中限宽（页面 full 宽，但表单不必拉满） */
.redeem-form { max-width: 520px; margin: 0 auto; }

/* sidebar 签到项已签到态 */
.sidebar-checkin.done { cursor: default; }
.sidebar-checkin.done .si-icon { color: var(--color-success); }
.sidebar-checkin.done .si-label { color: var(--text-tertiary); }

/* ============================================================
   6. 页面特殊样式
   ============================================================ */

/* ---- 子导航（充值中心 4 页共用） ---- */
.sub-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.sub-tabs::-webkit-scrollbar { display: none; }
.sub-tab {
    padding: 7px 14px;
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.sub-tab:hover { color: var(--text-primary); text-decoration: none; }
.sub-tab.active {
    color: var(--text-primary);
    background: var(--bg-page);
    font-weight: 500;
}

/* 新完成未查看红点（首页最近文章 + 我的文章列表共用） */
.r-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
    animation: r-dot-pulse 1.8s ease-out infinite;
}
/* 状态标签容器：始终为红点预留固定左侧位置（首页 + 列表共用）。
   红点绝对定位，不占文档流——这样有无红点时状态标签起点都一致，跨行不错位。 */
.r-status {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-left: 16px;
}
.r-status .r-dot {
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
}
@keyframes r-dot-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
    70%  { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
/* 我的文章列表「文章」列：原文前缀标题，点击进详情；限宽 + 单行省略号，避免撑宽表格 */
.table .art-title { max-width: 240px; }
.table .art-title a {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}
.table .art-title a:hover { color: var(--accent, #4f46e5); text-decoration: underline; }

/* ---- 文章详情：原文/结果对比 ---- */
/* 详情页顶部居中标题 + 元信息条 */
.article-detail-title { text-align: center; margin: 8px 0 18px; }
.article-detail-title h1 { font-size: 24px; margin: 0 0 6px; }
.article-info-bar {
    display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center;
    padding: 12px 18px; background: var(--bg-input);
    border-radius: var(--radius-md); margin-bottom: 16px;
    font-size: 13px; color: var(--text-secondary);
}
.article-info-bar .info-item strong { color: var(--text-primary); font-weight: 500; }

/* 详情页换强度重提区 */
.retry-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.retry-info { display: flex; flex-direction: column; gap: 2px; }
.retry-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 768px) {
    .retry-box { flex-direction: column; align-items: stretch; }
    .retry-controls { flex-direction: column; align-items: stretch; }
    .retry-controls .strength-pills { width: 100%; }
    .retry-controls .btn { width: 100%; justify-content: center; }
}

/* 双栏对比（原文 / 处理结果） */
.article-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;   /* 两栏等高 */
}
.article-pane {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pane-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}
.pane-head .pane-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 600; color: var(--text-primary);
    margin: 0;
}
.pane-head .pane-title svg { color: var(--text-secondary); }
.pane-head .pane-title.success svg { color: var(--color-success); }
.detect-link {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-tertiary);
    text-decoration: none;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    white-space: nowrap;
}
.detect-link:hover { color: var(--text-primary); background: var(--border-light); }
.pane-head .pane-extra { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.pane-body {
    padding: 18px;
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 14px;
    color: var(--text-primary);
    overflow-y: auto;
    height: 600px;        /* 两栏固定等高，不随内容多少变化 */
}
/* 可编辑文本域版本（详情页原文 / 结果，等高、可编辑） */
textarea.pane-body {
    width: 100%;
    display: block;
    border: none;
    background: transparent;
    outline: none;
    resize: vertical;
    font-family: inherit;
}
textarea.pane-body:focus { background: var(--bg-page); }
.pane-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 12px 18px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}
.pane-foot .word-stat {
    font-size: 13px; color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 6px;
}
.pane-foot .word-stat svg { color: var(--text-tertiary); }
.pane-foot .pane-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* 结果区「再处理一篇」默认隐藏，仅移动端显示（见 @media≤768px；桌面端左侧原文区已有同款） */
.pane-reprocess { display: none; }
.pane-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px; padding: 48px 18px; text-align: center;
    color: var(--text-tertiary); min-height: 340px;
}
/* 兼容：无结果时单栏原文展示 */
.article-pane .pane-content {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 14px;
    color: var(--text-primary);
    max-height: 520px;
    overflow-y: auto;
}
.article-meta-table { width: 100%; }
.article-meta-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    text-align: left;
    padding: 8px 0;
    width: 100px;
}
.article-meta-table td {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

/* ---- 登录页：居中卡片（无 sidebar） ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-page);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.auth-card h2 {
    margin: 0 0 8px;
    text-align: center;
    font-size: 22px;
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 24px;
    font-size: 13px;
}

/* ---- 大数字徽章（个人设置/积分明细顶部） ---- */
.big-number {
    text-align: center;
}
.big-number .label {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 4px;
}
.big-number .value {
    font-size: 36px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}
.big-number .actions {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- 工具样式 ---- */
.flex-between {
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.flex-center {
    display: flex; align-items: center; gap: 8px;
}
.text-muted { color: var(--text-secondary); }
.text-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ============================================================
   7. 移动端适配
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.collapsed { /* 移动端不允许收起，全开或全关 */
        width: var(--sidebar-w);
        transform: translateX(-100%);
    }

    .main { margin-left: 0 !important; }

    .topbar-mobile-toggle { display: inline-flex; width: 44px; height: 44px; margin-left: -6px; }
    .topbar-mobile-toggle svg { width: 26px; height: 26px; }
    .topbar-left { min-width: 0; }
    .topbar-announcement { max-width: 48vw; }
    .topbar-link { display: none; }

    .content { padding: 8px 16px 80px; }

    .article-compare { grid-template-columns: 1fr; }
    /* 手机端：处理结果区置顶、原文在下，打开即见结果可直接复制 */
    .article-compare .pane-result { order: 1; }
    .article-compare .pane-orig   { order: 2; }
    /* 手机端：隐藏朱雀/GPTZero 检测外链与「导出文本」，结果区只留「复制结果」 */
    .pane-result .detect-link { display: none; }
    .pane-result .pane-export { display: none; }
    /* 结果区「再处理一篇」仅移动端显示（桌面端左侧原文区已有同款，避免重复） */
    .pane-reprocess { display: inline-flex; }
    .pane-body { height: 400px; }
    .pane-foot { padding: 10px 14px; }
    .pane-head { padding: 12px 14px; }
    .article-info-bar { gap: 4px 16px; padding: 10px 14px; }

    h1 { font-size: 22px; }
    h2 { font-size: 18px; }
    /* 提示条更矮：减小内边距/外边距/字号，空占位也更紧凑 */
    .alert { padding: 8px 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.5; }
    #submit-alert { min-height: calc(1.5em + 16px); }

    .card { padding: 16px; border-radius: var(--radius-md); }

    /* 输入类元素统一 ≥16px，消除 iOS 聚焦时的自动放大（保留双指缩放，不锁 viewport） */
    .form-control, textarea.pane-body, input, textarea, select { font-size: 16px; }

    .table th, .table td { padding: 10px 12px; font-size: 13px; white-space: nowrap; }
    /* 移动端表格横向滚动；标题列进一步收窄，避免占用过多宽度 */
    .table .art-title { max-width: 150px; }

    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal {
        max-width: none;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        max-height: 88vh;
        animation: modal-slide-up 0.25s ease;
    }
    @keyframes modal-slide-up {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .auth-card { padding: 24px; }
}

/* ============================================================
   8. 配合 JS 的交互细节
   ============================================================ */
/* 主题切换图标：浅色时显示 moon（点击切到深色），深色时显示 sun（点击切到浅色） */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: inline-flex; }
[data-theme="dark"] .theme-icon-sun { display: inline-flex; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* sidebar 收起状态：html data-sidebar 用于首屏防抖 */
html[data-sidebar="collapsed"] .sidebar { width: var(--sidebar-w-collapsed); }
html[data-sidebar="collapsed"] .sidebar .si-label,
html[data-sidebar="collapsed"] .sidebar .si-dot,
html[data-sidebar="collapsed"] .sidebar .si-new,
html[data-sidebar="collapsed"] .sidebar .sidebar-section,
html[data-sidebar="collapsed"] .sidebar .sidebar-logo,
html[data-sidebar="collapsed"] .sidebar .user-meta { display: none; }
html[data-sidebar="collapsed"] .sidebar .sidebar-header { justify-content: center; padding: 0; }
html[data-sidebar="collapsed"] .sidebar .sidebar-item { justify-content: center; padding: 8px; }
html[data-sidebar="collapsed"] .sidebar .sidebar-user { justify-content: center; padding: 8px; }
html[data-sidebar="collapsed"] .main { margin-left: var(--sidebar-w-collapsed); }
@media (max-width: 768px) {
    html[data-sidebar="collapsed"] .sidebar {
        width: var(--sidebar-w);
        transform: translateX(-100%);
    }
    html[data-sidebar="collapsed"] .main { margin-left: 0; }
}

/* 兼容旧布局类，防止某些尚未迁移的页面挂掉 */
.container { display: none; }   /* 老模板已废弃，不应再出现 */

/* 404 大数字 */
.error-code {
    font-size: 64px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-primary);
}

/* 小工具 */
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger  { color: var(--color-danger); }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }

/* ============ 首次登录积分到账庆祝动画 ============ */
.bonus-celebrate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 18, 30, 0);
    opacity: 0;
    transition: opacity .3s ease, background .3s ease;
    overflow: hidden;
}
.bonus-celebrate.show {
    opacity: 1;
    background: rgba(15, 18, 30, 0.55);
}
.bonus-celebrate.closing { opacity: 0; }

.bonus-card {
    position: relative;
    width: min(88vw, 420px);
    padding: 30px 26px 26px;
    border-radius: 22px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #6a5cff 0%, #b14cff 45%, #ff5c9d 100%);
    background-size: 200% 200%;
    box-shadow: 0 24px 60px rgba(90, 40, 160, .45);
    transform: translateY(30px) scale(.85);
    opacity: 0;
    animation: bonus-gradient 6s ease infinite;
}
.bonus-celebrate.show .bonus-card {
    animation: bonus-pop .55s cubic-bezier(.2, 1.4, .4, 1) forwards, bonus-gradient 6s ease infinite;
}
@keyframes bonus-pop {
    0%   { transform: translateY(30px) scale(.85); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes bonus-gradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
.bonus-emoji {
    font-size: 46px;
    line-height: 1;
    margin-bottom: 8px;
    animation: bonus-bounce 1.6s ease-in-out infinite;
}
@keyframes bonus-bounce {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-8px) rotate(6deg); }
}
.bonus-title { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.bonus-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}
.bonus-num {
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.bonus-unit { font-size: 15px; opacity: .92; }
.bonus-sub { font-size: 13px; opacity: .9; margin: 0 0 20px; line-height: 1.6; }
.bonus-btn {
    border: none;
    cursor: pointer;
    background: #fff;
    color: #7b3cff;
    font-size: 15px;
    font-weight: 600;
    padding: 11px 28px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    transition: transform .15s ease;
}
.bonus-btn:hover { transform: translateY(-1px) scale(1.03); }

/* 彩色纸屑：从顶部洒落 */
.bonus-confetti { position: absolute; inset: 0; pointer-events: none; }
.bonus-confetti span {
    position: absolute;
    top: -20px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
}
.bonus-celebrate.show .bonus-confetti span {
    animation-name: bonus-fall;
    animation-timing-function: ease-in;
    animation-iteration-count: infinite;
}
@keyframes bonus-fall {
    0%   { transform: translateY(-20px) rotate(0deg);   opacity: 0; }
    10%  { opacity: 1; }
    100% { transform: translateY(102vh) rotate(540deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .bonus-card, .bonus-emoji, .bonus-confetti span { animation: none !important; }
    .bonus-celebrate.show .bonus-card { transform: none; opacity: 1; }
}

/* ============ 移动端：禁用双击缩放，稳定视图（保留双指缩放/滚动） ============ */
html { touch-action: manipulation; }
textarea, input, button, .btn, a.btn, .strength-pill, .composer { touch-action: manipulation; }

/* ============ 积分到账彩带提示（任意方式新增积分时） ============ */
.points-pop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}
.points-pop.show { opacity: 1; }
.points-pop-confetti { position: absolute; inset: 0; overflow: hidden; }
.points-pop-confetti span {
    position: absolute;
    top: -16px;
    width: 9px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
}
.points-pop.show .points-pop-confetti span {
    animation-name: bonus-fall;
    animation-timing-function: ease-in;
    animation-iteration-count: 1;
}
.points-pop-banner {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%) scale(.8);
    background: linear-gradient(135deg, #6a5cff, #b14cff 55%, #ff5c9d);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 13px 24px;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(120, 60, 180, .4);
    text-align: center;
    max-width: 84vw;
    line-height: 1.5;
    text-wrap: balance;
    opacity: 0;
}
.points-pop-banner b { font-size: 22px; margin: 0 3px; }
.points-pop-reason { font-size: 12px; font-weight: 400; opacity: .92; margin-top: 5px; line-height: 1.45; }
.points-pop.show .points-pop-banner {
    animation: points-pop-in .5s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
@keyframes points-pop-in {
    0%   { transform: translateX(-50%) scale(.8); opacity: 0; }
    100% { transform: translateX(-50%) scale(1);  opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .points-pop-confetti span { animation: none !important; }
    .points-pop.show .points-pop-banner { animation: none !important; opacity: 1; transform: translateX(-50%); }
}
/* 移动端：彩带横幅更宽更大，长来源文案换行更舒展 */
@media (max-width: 768px) {
    .points-pop-banner {
        max-width: 92vw;
        font-size: 17px;
        padding: 16px 22px;
        line-height: 1.55;
        border-radius: 20px;
    }
    .points-pop-banner b { font-size: 24px; }
    .points-pop-reason { font-size: 13px; line-height: 1.5; margin-top: 7px; }
}
