/* 模组通 - MC风格覆盖样式 */

:root {
    --brand: #5B9C32;
    --brand-light: #78C84F;
    --brand-dark: #4A7F28;
    --brand-bg: rgba(91, 156, 50, 0.08);
    --bg: #FAF9F6;
    --surface: #FFFFFF;
    --surface-soft: #F5F2EB;
    --border: #ECE9E2;
    --border-soft: #F3F1EB;
    --text: #2C2A26;
    --text-secondary: #6E6A62;
    --text-muted: #A8A296;
    --danger: #C0392B;
    --warning: #D4843E;
    --gold: #C9A84C;
    --silver: #9E9E9E;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --radius: 12px;
    /* DaisyUI 需要的 CSS 变量 */
    --b1: 255 255 255;
    --bc: 44 42 38;
    --rounded-btn: 0.5rem;
    --fallback-b1: 255 255 255;
    --tw-bg-opacity: 1;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}
.page-body { flex: 1; }

a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D4D0C8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B8B4AC; }
::selection { background: rgba(91,156,50,0.2); color: #3D6B20; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-pulse { animation: pulse 2s infinite; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ==================== 通用容器 ==================== */
.container { width: 100%; margin: 0 auto; padding: 0 24px; }
@media (min-width: 640px)  { .container { max-width: 640px; } }
@media (min-width: 768px)  { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1240px; } }
@media (min-width: 1536px) { .container { max-width: 1440px; } }

/* ==================== 通用表单元素 ==================== */
/* 覆盖 DaisyUI 的 .textarea / .select 类，避免边框透明等问题 */
.textarea, .select {
    width: 100% !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    background-color: white !important;
    color: var(--text) !important;
    outline: none !important;
    font-family: inherit !important;
    line-height: 1.6 !important;
    min-height: auto !important;
    height: auto !important;
}
/* 恢复 DaisyUI select 下拉箭头 */
.select {
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
    background-position: calc(100% - 14px) calc(50% + 1px),
        calc(100% - 10px) calc(50% + 1px) !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
    padding-right: 36px !important;
}
.textarea:focus, .select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px var(--brand-bg) !important;
    outline: none !important;
}
/* 覆盖 DaisyUI btn-ghost / btn-sm / btn-lg 可能带来的额外阴影和轮廓 */
.btn-ghost { box-shadow: none !important; }
.btn-sm { min-height: auto !important; height: auto !important; }
.btn-lg { min-height: auto !important; height: auto !important; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
input[type="checkbox"], input[type="radio"] {
    width: auto;
    accent-color: var(--brand);
}
input:focus, textarea:focus, select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-bg);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
button { font-family: inherit; }

/* ==================== 通用按钮 ==================== */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; font-size: 14px; font-weight: 500; color: white;
    background: var(--brand); border: none; border-radius: 10px; cursor: pointer;
    transition: all 0.15s; box-shadow: 0 2px 8px rgba(91,156,50,0.25);
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
/* 修复 DaisyUI btn:disabled 三层透明度叠加导致文字不可见 */
.btn-primary:disabled,
.btn.btn-primary:disabled {
    --tw-text-opacity: 1 !important;
    --tw-bg-opacity: 1 !important;
    --tw-border-opacity: 1 !important;
    background-color: var(--brand) !important;
    color: rgba(255,255,255,0.5) !important;
}

.btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; font-size: 14px; font-weight: 500; color: var(--text);
    background: white; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
    transition: all 0.15s;
}
.btn-secondary:hover { border-color: var(--text-secondary); background: var(--surface-soft); }

/* ==================== 通用卡片 ==================== */
.card {
    background: white; border: 1px solid var(--border); border-radius: 16px;
    padding: 20px; box-shadow: var(--shadow-sm);
}

/* ==================== 导航栏（56px，玻璃态优化） ==================== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 100;
    background: rgba(255,255,255,0.72);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.35s ease, backdrop-filter 0.35s ease, border-color 0.35s ease, border-radius 0.35s ease, box-shadow 0.35s ease, top 0.35s ease;
}
.navbar-inner {
    display: flex; align-items: center; height: 100%;
    max-width: 1240px; margin: 0 auto; padding: 0 24px;
}
.navbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.navbar .logo-icon {
    height: 38px; width: auto; border-radius: 4px;
    flex-shrink: 0; object-fit: contain;
}
.navbar .logo { font-weight: 700; font-size: 16px; color: var(--text); }
.navbar-links { display: flex; align-items: center; gap: 4px; margin-left: 36px; }
.navbar .nav-link {
    color: var(--text-secondary); font-size: 13px; padding: 6px 14px; border-radius: 8px;
    transition: all 0.15s; text-decoration: none; white-space: nowrap;
}
.navbar .nav-link:hover { background: rgba(0,0,0,0.05); color: var(--brand); }
.navbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.navbar .nav-user { color: var(--text-secondary); font-size: 13px; }
.navbar .btn-login {
    color: var(--text-secondary); font-size: 13px; padding: 6px 14px; border-radius: 8px;
    background: transparent; border: none; cursor: pointer; text-decoration: none; transition: all 0.15s;
}
.navbar .btn-login.nav-logout { color: var(--text-muted); font-size: 13px; }
.navbar .btn-login.nav-logout:hover { color: var(--danger); }
.navbar .btn-login:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.navbar .btn-register {
    font-size: 13px; padding: 6px 16px; border-radius: 8px; background: var(--brand); color: white;
    border: none; cursor: pointer; font-weight: 500; box-shadow: 0 2px 8px rgba(91,156,50,0.25);
    text-decoration: none; transition: background 0.15s; white-space: nowrap;
}
.navbar .btn-register:hover { background: var(--brand-light); }

/* 汉堡菜单按钮 */
.navbar-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    width: 36px; height: 36px; padding: 8px; margin-left: auto;
    background: none; border: none; cursor: pointer; border-radius: 6px;
}
.navbar-toggle span {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: var(--text); transition: all 0.2s;
}
.navbar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; }
.navbar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端下拉菜单 */
.navbar-mobile {
    display: none; flex-direction: column;
    position: absolute; top: 56px; left: 0; right: 0;
    background: white; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg); padding: 8px 16px;
    z-index: 99;
}
.navbar-mobile.open { display: flex; }
.nav-mobile-link {
    display: block; padding: 12px 16px; font-size: 14px; color: var(--text);
    text-decoration: none; border-radius: 8px; transition: background 0.1s;
}
.nav-mobile-link:hover { background: var(--surface-soft); }
.nav-mobile-link.nav-mobile-cta { color: var(--brand); font-weight: 600; }
.nav-mobile-link.nav-mobile-logout { color: var(--text-muted); background: none; border: none; text-align: left; width: 100%; cursor: pointer; font-family: inherit; }
.nav-mobile-link.nav-mobile-logout:hover { color: var(--danger); background: var(--surface-soft); }
.navbar-mobile-divider { height: 1px; background: var(--border); margin: 4px 8px; }

/* ---- Hero上透明态（极透玻璃） ---- */
.navbar.on-hero {
    height: 56px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(16px) saturate(100%);
    -webkit-backdrop-filter: blur(16px) saturate(100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.15);
    top: 12px; left: 12px; right: 12px;
}
.navbar.on-hero .logo { color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.navbar.on-hero .nav-link { color: rgba(255,255,255,0.8); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.navbar.on-hero .nav-link:hover { color: white; background: rgba(255,255,255,0.15); }
.navbar.on-hero .nav-user { color: rgba(255,255,255,0.7); }
.navbar.on-hero .btn-login { color: rgba(255,255,255,0.85); text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.navbar.on-hero .btn-login:hover { color: white; background: rgba(255,255,255,0.15); }
.navbar.on-hero .navbar-toggle span { background: white; }

/* ---- 滚动后贴边（融回页面底色） ---- */
.navbar.scrolled {
    top: 0; left: 0; right: 0; border-radius: 0; height: 56px;
    background: rgba(250,249,246,0.80);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.navbar.scrolled .logo, .navbar.scrolled .nav-link,
.navbar.scrolled .btn-login, .navbar.scrolled .nav-user {
    color: var(--text-secondary); text-shadow: none;
}
.navbar.scrolled .nav-link:hover { background: rgba(0,0,0,0.05); color: var(--brand); }
.navbar.scrolled .btn-login:hover { background: rgba(0,0,0,0.05); color: var(--text); }
.navbar.scrolled .navbar-toggle span { background: var(--text); }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .navbar-inner { padding: 0 16px; }
    .navbar-links { display: none; }
    .navbar-actions { display: none; }
    .navbar-toggle { display: flex; }
    .navbar.on-hero {
        top: 8px; left: 8px; right: 8px; border-radius: 12px;
    }
    .navbar.on-hero .navbar-mobile { top: 56px; }
}
@media (min-width: 769px) {
    .navbar-toggle { display: none !important; }
    .navbar-mobile { display: none !important; }
}

/* ==================== Hero两侧装饰 ==================== */
.hero-side-left, .hero-side-right { display: none; }
/* 手机端快捷入口和工具栏默认隐藏 */
.hero-mobile-quick { display: none; }
.chat-mobile-toolbar { display: none; }
@media (min-width: 1400px) {
    .hero-side-left, .hero-side-right {
        display: flex !important; flex-direction: column; gap: 12px;
        position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 180px;
    }
    .hero-side-left { left: 32px; }
    .hero-side-right { right: 32px; }
    .hero-info-card {
        display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px;
        background: rgba(255,255,255,0.08); backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%);
        border: 1px solid rgba(255,255,255,0.12);
    }
}
 
/* ==================== 对话窗口 (DeepSeek 横版风格) ==================== */
.chat-window {
    width: 100%; max-width: 1320px; margin: 0 auto;
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); position: relative; z-index: 30;
    display: flex; height: 500px; min-height: 500px;
}

/* 左侧边栏 */
.chat-sidebar {
    width: 260px; flex-shrink: 0; min-width: 0;
    background: #f9fafb; border-right: 1px solid #f3f4f6;
    display: flex; flex-direction: column; padding: 16px;
}
.chat-sidebar-new-btn {
    width: 100%; height: 36px; border-radius: 8px; border: none;
    background: #059669; color: #fff; font-size: 14px; font-weight: 500;
    cursor: pointer; font-family: inherit; display: flex; align-items: center;
    justify-content: center; gap: 6px; margin-bottom: 16px; flex-shrink: 0;
}
.chat-sidebar-new-btn:hover { background: #047857; }

.chat-sidebar-nav {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.chat-nav-item {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 36px;
    padding: 0 12px; border-radius: 6px; border: none; background: transparent;
    font-size: 13px; color: #374151; cursor: pointer; font-family: inherit;
    text-align: left; border-left: 2px solid transparent; transition: none;
}
.chat-nav-item i { color: #6b7280; flex-shrink: 0; }
.chat-nav-item:hover { background: #f3f4f6; }
.chat-nav-item.active {
    background: #ecfdf5; color: #047857; border-left-color: #059669;
}
.chat-nav-item.active i { color: #047857; }

.chat-sidebar-config {
    margin-top: 12px; flex-shrink: 0;
}
.chat-sidebar-config-btn {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px;
    font-size: 12px; color: #9ca3af; background: transparent;
    border: 1px solid #e5e7eb; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.chat-sidebar-config-btn:hover { border-color: #9ca3af; }
.chat-sidebar-config-panel {
    display: none; flex-direction: column; gap: 5px; padding-top: 8px;
}
.chat-sidebar-config-panel.show { display: flex; }
.config-select {
    font-size: 12px; padding: 5px 8px; border: 1px solid #e5e7eb; border-radius: 6px;
    background: #fff; color: #374151; outline: none; cursor: pointer; width: 100%;
}
.config-select:focus { border-color: #059669; }
.config-select-sm {
    font-size: 11px; padding: 4px 6px; border: 1px solid #e5e7eb; border-radius: 4px;
    background: #fff; color: #374151; outline: none; cursor: pointer; width: 100%;
}
.config-fill-btn {
    font-size: 12px; padding: 5px 12px; border-radius: 6px; color: #fff; background: #059669;
    border: none; cursor: pointer; font-family: inherit;
}
.config-clear-btn {
    font-size: 12px; padding: 5px 12px; border-radius: 6px; color: #6b7280;
    background: #f3f4f6; border: none; cursor: pointer; font-family: inherit;
}

/* 右侧聊天区 */
.chat-main {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
}

/* 顶部标题栏 */
.chat-main-header {
    display: flex; align-items: center; justify-content: space-between;
    height: 44px; padding: 0 20px; border-bottom: 1px solid #f3f4f6; flex-shrink: 0;
}
.chat-main-header-left {
    display: flex; align-items: center; gap: 8px;
}
.chat-main-logo {
    width: 22px; height: 22px; border-radius: 4px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.chat-main-logo img { width: 100%; height: 100%; object-fit: contain; }
.chat-main-title { font-size: 14px; font-weight: 500; color: #1f2937; }
.chat-clear-btn {
    font-size: 12px; color: #6b7280; background: none; border: none; cursor: pointer; padding: 0; font-family: inherit;
}
.chat-clear-btn:hover { color: #ef4444; }

/* 聊天内容区 */
.chat-body {
    flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px;
}

/* 欢迎区 */
.chat-welcome {
    display: flex; flex-direction: column; align-items: center;
    padding-top: 40px; gap: 12px;
}
.chat-welcome-logo {
    width: 40px; height: 40px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    margin-bottom: 4px;
}
.chat-welcome-logo img { width: 100%; height: 100%; object-fit: contain; }
.chat-welcome-title { font-size: 18px; font-weight: 600; color: #1f2937; }
.chat-welcome-subtitle { font-size: 13px; color: #6b7280; }

/* 快捷卡片 2x3 */
.chat-quick-cards {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-top: 20px; width: 100%; max-width: 480px;
}
.chat-quick-card {
    display: flex; flex-direction: column; gap: 2px; padding: 8px 12px;
    border-radius: 6px; border: none; background: #f3f4f6;
    cursor: pointer; font-family: inherit; text-align: left;
    width: 100%; transition: background 0.15s;
}
.chat-quick-card:hover { background: #e5e7eb; }
.chat-quick-card-header { display: flex; align-items: center; gap: 6px; }
.chat-quick-card-title { font-size: 12px; font-weight: 500; color: #374151; }
.chat-quick-card-desc { font-size: 11px; color: #9ca3af; line-height: 1.4; }
.chat-quick-card i { color: #6b7280; flex-shrink: 0; }

/* 对话消息 */
.chat-conversation { display: flex; flex-direction: column; gap: 16px; }
.chat-msg-row {
    display: flex; gap: 10px; align-items: flex-start; min-width: 0;
}
.chat-msg-row-user { flex-direction: row-reverse; }
.chat-avatar {
    width: 28px; height: 28px; min-width: 28px; border-radius: 6px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: contain; }
.chat-avatar-user { background: #e5e7eb; color: #6b7280; }
.chat-bubble {
    max-width: 75%; min-width: 0; padding: 10px 14px; border-radius: 8px;
    font-size: 14px; line-height: 1.6; word-break: break-word; overflow-wrap: break-word;
}
.chat-bubble pre { white-space: pre-wrap; overflow-wrap: break-word; }
.chat-bubble code { word-break: break-all; }
.chat-bubble-assistant { background: #f3f4f6; color: #1f2937; }
.chat-bubble-user { background: #059669; color: #fff; }
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble p:last-child { margin: 0; }
.chat-bubble strong { font-weight: 600; }

/* 气泡底部操作 */
.chat-bubble-actions { display: flex; gap: 4px; margin-top: 6px; }
.chat-bubble-action {
    width: 28px; height: 28px; border-radius: 4px; display: flex;
    align-items: center; justify-content: center;
    color: #9ca3af; background: transparent; border: none; cursor: pointer;
}
.chat-bubble-action:hover { background: #f3f4f6; color: #6b7280; }

/* 附件 */
#chat-attached-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; width: 100%; }
#chat-attached-files:empty { display: none; }
.chat-file-tag-large { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 6px; color: #374151; }
.chat-file-remove { background: none; border: none; font-size: 14px; color: #9ca3af; cursor: pointer; }
.chat-file-remove:hover { color: #ef4444; }
.chat-result-card { margin-top: 8px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; min-width: 0; max-width: 100%; }
.chat-result-card-title { padding: 8px 12px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; font-size: 13px; font-weight: 600; color: #1f2937; }
.chat-result-card-item { padding: 8px 12px; font-size: 13px; line-height: 1.6; color: #374151; word-break: break-word; }
.chat-suggestions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0; }
.chat-suggestion-btn { padding: 4px 10px; font-size: 12px; background: #ecfdf5; color: #059669; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.chat-suggestion-btn:hover { background: #059669; color: #fff; }

/* 底部输入栏 */
.chat-input-area {
    min-height: 64px; height: auto; padding: 8px 16px; flex-shrink: 0;
    border-top: 1px solid #f3f4f6; display: flex; flex-wrap: wrap;
    align-items: center; gap: 4px;
}
.chat-input-row {
    display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
    min-height: 40px; height: auto; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 4px 12px; transition: border-color 0.15s;
}
.chat-input-row:focus-within { border-color: #059669; }
.chat-input-icon {
    width: 24px; height: 24px; border-radius: 4px; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    color: #9ca3af; background: transparent; border: none; cursor: pointer;
}
.chat-input-icon:hover { color: #6b7280; }
.chat-textarea {
    flex: 1 1 auto; min-width: 0; background: transparent; border: none; outline: none; resize: none;
    font-size: 13px; line-height: 1.4; height: 20px; min-height: 20px;
    padding: 0; font-family: inherit; color: #1f2937;
}
.chat-textarea::placeholder { color: #9ca3af; }
.chat-send-btn {
    width: 28px; height: 28px; border-radius: 6px; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    color: #fff; background: #059669; border: none; cursor: pointer;
    transition: all 0.15s;
}
.chat-send-btn:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.chat-footer-text { font-size: 11px; color: #9ca3af; margin-left: 8px; flex-shrink: 0; }

/* ==================== 功能卡片 ==================== */
.feature-link {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: white;
    border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); transition: all 0.15s;
}
.feature-link:hover { border-color: var(--brand); box-shadow: 0 4px 12px rgba(91,156,50,0.08); transform: translateY(-2px); }
.feature-icon-wrap {
    width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: var(--brand-bg); color: var(--brand); flex-shrink: 0;
}

/* ==================== 启动器/模组图标 ==================== */
.launcher-icon {
    width: 36px; height: 36px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
    background: var(--surface-soft); display: flex; align-items: center; justify-content: center;
}
.launcher-icon img { width: 100%; height: 100%; object-fit: cover; }
.launcher-icon-fallback {
    width: 100%; height: 100%; background: var(--brand-bg); color: var(--brand);
    display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.mod-icon { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--surface-soft); }
.mod-icon-fallback { width: 32px; height: 32px; border-radius: 8px; background: var(--surface-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ==================== 排行榜 ==================== */
.ranking-scroll-wrapper { position: relative; }
.ranking-scroll-track { will-change: transform; }
.ranking-scroll-wrapper.expanded { height: auto !important; overflow: visible !important; }
.ranking-scroll-wrapper.expanded .ranking-scroll-track { animation: none !important; transform: none !important; }
/* ==================== 排行榜 Tab 切换 ==================== */
.ranking-tab {
    padding: 6px 12px; border-radius: 6px;
    font-size: 12px; font-weight: 500; color: var(--text-secondary);
    background: transparent; border: none; cursor: pointer;
    transition: all 0.15s; font-family: inherit;
}
.ranking-tab:hover { color: var(--text); }
.ranking-tab.active {
    background: white; color: var(--text);
    box-shadow: var(--shadow-sm);
}

/* ==================== 排行榜滚动列表 ==================== */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); cursor: pointer; text-decoration: none; color: inherit; transition: background 0.15s; overflow: hidden; }
.rank-item:hover { background: var(--brand-bg); }
.rank-item[data-rank="1"], .rank-item[data-rank="2"], .rank-item[data-rank="3"] { border-left: 3px solid var(--brand); }
.rank-number { width: 48px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.rank-item[data-rank="1"] .rank-number { font-size: 18px; font-weight: 700; color: var(--text); }
.rank-item-icon { width: 28px; height: 28px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.rank-item-icon img { width: 100%; height: 100%; object-fit: contain; }
.rank-item-info { flex: 1; min-width: 0; overflow: hidden; }
.rank-item-name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rank-item-desc { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.rank-item-downloads { width: 80px; text-align: right; font-size: 14px; font-weight: 500; color: var(--text); flex-shrink: 0; }
.rank-item-trend { width: 30px; text-align: right; font-size: 12px; flex-shrink: 0; }
.rank-item-trend.up { color: var(--brand); }
.rank-item-trend.down { color: var(--danger); }
.rank-item-trend.stable { color: var(--text-muted); }
.expand-btn-icon { transition: transform 0.3s; }
.expand-btn.expanded .expand-btn-icon { transform: rotate(180deg); }
.loading-spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bug-severity-tag { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 500; border: 1px solid; border-radius: 4px; white-space: nowrap; }

/* ==================== Hero 过渡 ==================== */
.chat-window-wrapper { position: relative; z-index: 10; margin-bottom: 0; }

/* ==================== 响应式 ==================== */
/* 平板窄屏：收窄侧边栏，让对话区更宽 */
@media (max-width: 1150px) {
    .chat-sidebar { width: 230px; padding: 14px; }
    .chat-window { height: 480px; min-height: 480px; }
}
@media (max-width: 1024px) {
    .chat-sidebar { width: 210px; padding: 12px; }
    .chat-nav-item { font-size: 12px; padding: 0 10px; }
    .chat-window { height: 460px; min-height: 460px; }
    .chat-bubble { max-width: 80%; }
    .chat-quick-cards { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
}
@media (max-width: 900px) {
    .chat-sidebar { width: 190px; }
    .chat-quick-cards { grid-template-columns: repeat(2, 1fr); }
}
/* 手机端隐藏次要内容 */
.mobile-hide { }
@media (max-width: 768px) {
    .mobile-hide { display: none !important; }
}

@media (max-width: 768px) {
    /* ---- Hero 手机端精简 ---- */
    .hero { min-height: auto !important; padding: 86px 0 32px !important; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 13px; max-width: 280px; }
    .hero .inline-flex.items-center.gap-2.px-3 { display: none; }  /* 顶部徽章 */

    .chat-window { width: 100%; flex-direction: column; height: auto; min-height: 480px; }
    /* 桌面端侧边栏在手机上完全隐藏 */
    .chat-sidebar { display: none; }
    .chat-main { min-height: 400px; }
    .chat-input-area { height: auto; padding: 8px 12px; }
    .chat-body { padding: 12px; }
    .chat-quick-cards { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
    /* 手机端隐藏后 3 个快捷卡片（BUG/内存/Java），只保留核心 3 个 */
    .chat-quick-card:nth-child(n+4) { display: none; }
    .chat-welcome { padding-top: 20px; }
    .chat-bubble { max-width: 88%; }

    /* 手机端功能快捷栏 */
    .chat-mobile-toolbar {
        display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px;
        background: white; border-bottom: 1px solid var(--border);
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .chat-mobile-toolbar::-webkit-scrollbar { display: none; }
    .chat-mobile-tool {
        display: flex; flex-direction: column; align-items: center; gap: 3px;
        padding: 6px 10px; border-radius: 8px; flex-shrink: 0;
        background: none; border: none; cursor: pointer;
        font-size: 10px; color: var(--text-muted); font-family: inherit;
        min-width: 48px; transition: background 0.15s, color 0.15s;
    }
    .chat-mobile-tool:hover { background: var(--surface-soft); color: var(--text); }
    .chat-mobile-tool.active { background: var(--brand-bg); color: var(--brand); }
    .chat-mobile-tool svg { width: 18px; height: 18px; }

    /* Hero 手机端快捷入口 */
    .hero-mobile-quick {
        display: flex; justify-content: center; gap: 16px;
        padding: 0 16px 12px; position: relative; z-index: 10;
    }
    .hero-mobile-quick-item {
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        font-size: 10px; color: rgba(255,255,255,0.6);
    }
    .hero-mobile-quick-item svg { width: 18px; height: 18px; }

    .rank-item { padding: 10px 14px; gap: 8px; }
    .rank-item-desc { display: none; }
    .rank-item-downloads { width: 60px; font-size: 13px; }
    .layout-split { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    /* 统计条：手机端隐藏第 4 项（支持版本），改为 3 列 */
    .grid.grid-cols-2.md\:grid-cols-4 { grid-template-columns: repeat(3, 1fr); }
    .grid.grid-cols-2.md\:grid-cols-4 > :nth-child(4) { display: none; }
    .admin-settings-grid { grid-template-columns: 1fr; }
    .mod-detail-header { flex-direction: column; }
    .legal-page, .mod-detail-page { padding: 24px 16px; }
    .bug-filter-bar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
    .chat-window { width: 100%; height: auto; min-height: 420px; }
    .chat-sidebar { display: none; }
    .chat-quick-cards { grid-template-columns: 1fr; }
    .chat-welcome { padding-top: 16px; }
    .chat-welcome-logo { width: 32px; height: 32px; font-size: 14px; }
    .chat-welcome-title { font-size: 16px; }
    .chat-bubble { max-width: 92%; padding: 8px 12px; }
    .chat-footer-text { display: none; }
    .chat-main-header { padding: 0 12px; }
    .chat-input-area { padding: 6px 10px; }
    .chat-send-btn { width: 30px; height: 30px; }
    .chat-mobile-tool { padding: 4px 6px; font-size: 9px; min-width: 40px; }
    .chat-mobile-tool svg { width: 16px; height: 16px; }
    .hero-mobile-quick { gap: 10px; }
    .hero-mobile-quick-item { font-size: 9px; }
    .studio-cards { grid-template-columns: 1fr; }
    .page-main { padding: 20px 16px; }
    .legal-page { padding: 20px 16px; }
    .legal-title { font-size: 22px; }
}

/* ==================== 非首页通用页面样式 ==================== */
.page-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
}

/* 表单组 */
.form-group { margin-bottom: 16px; }
.form-group label, .form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* 两栏布局 */
.layout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* 登录/注册卡片 */
.auth-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow-md);
}
.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 4px;
}
.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}
.auth-form { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.auth-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(192,57,43,0.06);
    border-radius: 8px;
}
.auth-switch {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}
.auth-switch a {
    color: var(--brand);
    font-weight: 500;
}
.auth-switch a:hover { text-decoration: underline; }

/* VAPTCHA */
.vaptcha-btn {
    padding: 10px 16px;
    font-size: 13px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.vaptcha-btn:hover { border-color: var(--brand); color: var(--brand); }
.vaptcha-btn.vaptcha-verified { border-color: var(--brand); color: var(--brand); border-style: solid; background: var(--brand-bg); }
.vaptcha-btn:disabled { opacity: 0.7; cursor: default; }
.vaptcha-tip { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* OAuth 第三方登录 */
.oauth-section { margin-top: 20px; text-align: center; }
.oauth-divider {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px;
}
.oauth-divider::before, .oauth-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.oauth-divider span {
    font-size: 12px; color: var(--text-muted); white-space: nowrap;
}
.oauth-buttons {
    display: flex; gap: 12px; justify-content: center;
}
.oauth-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 20px; border-radius: 10px; border: 1px solid var(--border);
    background: white; cursor: pointer; transition: all 0.15s;
    font-size: 12px; font-weight: 500; color: var(--text-secondary);
    font-family: inherit; min-width: 72px;
}
.oauth-btn:hover { border-color: var(--text-muted); transform: translateY(-1px); }
.oauth-btn svg { width: 24px; height: 24px; }
.oauth-btn-qq { color: #12B7F5; }
.oauth-btn-qq:hover { border-color: #12B7F5; background: #F0FAFF; }
.oauth-btn-wx { color: #07C160; }
.oauth-btn-wx:hover { border-color: #07C160; background: #F0FFF4; }
.oauth-btn-alipay { color: #1677FF; }
.oauth-btn-alipay:hover { border-color: #1677FF; background: #F0F7FF; }

/* 排行榜/BUG页面 */
.ranking-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}
.ranking-page-container { max-width: 100%; }
.ranking-page-header {
    margin-bottom: 24px;
}
.ranking-page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.ranking-page-header p {
    font-size: 13px;
    color: var(--text-muted);
}
.ranking-page-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--border-soft);
    border-radius: 10px;
    width: fit-content;
}
.ranking-page-tab {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}
.ranking-page-tab:hover { color: var(--text); }
.ranking-page-tab.active {
    background: white;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.ranking-page-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 12px;
}
.ranking-page-live .live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    animation: pulse 2s infinite;
}
.ranking-page-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.ranking-page-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--border-soft);
    border-bottom: 1px solid var(--border);
}
.ranking-page-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text);
}
.ranking-page-table tr:hover td { background: var(--brand-bg); }
.ranking-page-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}
.ranking-page-pagination a,
.ranking-page-pagination span {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}
.ranking-page-pagination a:hover { border-color: var(--brand); color: var(--brand); }
.ranking-page-pagination .active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

/* 个人中心/历史记录 */
.profile-page { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.profile-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* ==================== 法律/信息页面 (legal-page) ==================== */
.legal-page { max-width: 860px; margin: 0 auto; padding: 40px 24px; }
.legal-container { }
.legal-title { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.legal-date { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; }
.legal-section { margin-bottom: 24px; }
.legal-section h2 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.legal-section p { font-size: 14px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 12px; }

/* ==================== 关于页面 ==================== */
.about-page { max-width: 960px; margin: 0 auto; padding: 64px 24px 80px; }
/* Hero */
.about-hero { text-align: center; margin-bottom: 64px; }
.about-hero-badge {
    display: inline-block; padding: 4px 14px; border-radius: 100px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--brand); background: var(--brand-bg); border: 1px solid rgba(91,156,50,0.15);
    margin-bottom: 24px;
}
.about-hero-title {
    font-size: 40px; font-weight: 800; line-height: 1.2; color: var(--text);
    letter-spacing: -0.5px; margin: 0 0 20px;
}
.about-hero-sub {
    font-size: 16px; line-height: 1.8; color: var(--text-secondary);
    max-width: 640px; margin: 0 auto;
}
.about-highlight {
    color: var(--text); font-weight: 600;
}

/* 数据条 */
.about-stats {
    display: flex; justify-content: center; align-items: center; gap: 0;
    padding: 40px 24px; margin-bottom: 64px;
    background: white; border: 1px solid var(--border); border-radius: 16px;
}
.about-stat {
    flex: 1; text-align: center; padding: 0 24px;
}
.about-stat-num {
    display: block; font-size: 32px; font-weight: 800; color: var(--text);
    letter-spacing: -0.5px; line-height: 1.2;
}
.about-stat-label {
    display: block; font-size: 13px; color: var(--text-muted); margin-top: 4px;
}
.about-stat-divider {
    width: 1px; height: 48px; background: var(--border); flex-shrink: 0;
}

/* Section */
.about-section { margin-bottom: 64px; }
.about-section-title {
    font-size: 22px; font-weight: 700; color: var(--text);
    margin: 0 0 24px; letter-spacing: -0.3px;
}

/* 使命 */
.about-mission-card {
    background: white; border: 1px solid var(--border);
    border-radius: 14px; padding: 28px 32px;
}
.about-mission-card p {
    font-size: 15px; line-height: 1.8; color: var(--text-secondary); margin: 0;
}
.about-mission-card p + p { margin-top: 16px; }

/* 功能卡片 */
.about-features {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.about-feature-card {
    background: white; border: 1px solid var(--border);
    border-radius: 14px; padding: 24px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.about-feature-card:hover {
    border-color: rgba(91,156,50,0.25);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.about-feature-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-bg); color: var(--brand); margin-bottom: 14px;
}
.about-feature-card h3 {
    font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 8px;
}
.about-feature-card p {
    font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 0;
}

/* 团队 */
.about-team-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.about-team-card {
    display: flex; gap: 20px; align-items: flex-start;
    background: white; border: 1px solid var(--border);
    border-radius: 14px; padding: 24px;
}
.about-team-avatar {
    width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700; color: white;
}
.about-team-info h3 {
    font-size: 16px; font-weight: 600; color: var(--text); margin: 0 0 4px;
}
.about-team-role {
    display: inline-block; font-size: 12px; font-weight: 500;
    color: var(--brand); background: var(--brand-bg);
    padding: 2px 8px; border-radius: 4px; margin-bottom: 8px;
}
.about-team-info p {
    font-size: 13px; line-height: 1.6; color: var(--text-muted); margin: 0;
}

/* 联系 */
.about-contact-card {
    background: white; border: 1px solid var(--border);
    border-radius: 14px; padding: 24px 28px;
    display: flex; flex-direction: column; gap: 12px;
}
.about-contact-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: var(--text-secondary);
}
.about-contact-row i { color: var(--text-muted); flex-shrink: 0; }
.about-contact-row a { color: var(--brand); text-decoration: none; }
.about-contact-row a:hover { text-decoration: underline; }

/* ==================== 关于页手机端 ==================== */
@media (max-width: 768px) {
    .about-page { padding: 40px 16px 60px; }
    .about-hero { margin-bottom: 40px; }
    .about-hero-title { font-size: 28px; }
    .about-hero-sub { font-size: 14px; }
    .about-stats {
        flex-wrap: wrap; padding: 20px 12px; gap: 0;
    }
    .about-stat { flex: 1 1 50%; padding: 12px 8px; }
    .about-stat-divider:nth-child(2) { display: none; } /* 第1个分割线隐藏 */
    .about-stat-divider:nth-child(6) { width: 100%; height: 1px; margin: 4px 0; } /* 第3个变成水平 */
    .about-stat-num { font-size: 26px; }
    .about-features { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .about-feature-card { padding: 18px; }
    .about-team-grid { grid-template-columns: 1fr; gap: 12px; }
    .about-mission-card { padding: 20px; }
    .about-mission-card p { font-size: 14px; }
    .about-section { margin-bottom: 40px; }
}
@media (max-width: 480px) {
    .about-hero-title { font-size: 24px; }
    .about-hero-sub { font-size: 13px; }
    .about-features { grid-template-columns: 1fr; }
    .about-stat-num { font-size: 22px; }
    .about-feature-card { padding: 16px; }
    .about-team-card { flex-direction: column; gap: 12px; align-items: flex-start; }
    .about-contact-card { padding: 18px 16px; }
}

/* ==================== 模组详情页 ==================== */
.mod-detail-page { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.mod-detail-container { }
.mod-detail-header { display: flex; gap: 16px; margin-bottom: 24px; }
.mod-detail-icon { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.mod-detail-info { flex: 1; }
.mod-detail-name { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.mod-detail-meta { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.mod-tag { display: inline-block; padding: 3px 10px; font-size: 12px; border-radius: 6px; font-weight: 500; }
.mod-tag-dl { background: var(--brand-bg); color: var(--brand); }
.mod-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mod-detail-section { margin-bottom: 24px; }
.mod-detail-section h2 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.mod-detail-list { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mod-detail-list > * { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.mod-detail-list > *:last-child { border-bottom: none; }
.mod-detail-conflicts { color: var(--danger); }
.mod-download-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; background: var(--brand); color: white; border-radius: 10px; font-size: 14px; font-weight: 500; text-decoration: none; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--brand); }
.breadcrumb-sep { margin: 0 6px; color: var(--border); }
.breadcrumb-current { color: var(--text-secondary); }

/* ==================== 排行榜/BUG表格 ==================== */
.ranking-page-table-wrapper { overflow-x: auto; }
.rank-row { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); transition: background 0.15s; text-decoration: none; color: inherit; }
.rank-row:hover { background: var(--brand-bg); }
.rank-num { width: 40px; font-size: 14px; font-weight: 600; color: var(--text-muted); flex-shrink: 0; }
.rank-num-top { color: var(--gold); font-weight: 700; }
.rank-num-normal { color: var(--text-muted); }
.rank-change { font-size: 12px; margin-left: 4px; }
.rank-change.up { color: var(--brand); }
.rank-change.down { color: var(--danger); }
.rank-change.new { color: var(--brand); }
.rank-name-cell { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.rank-name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-desc { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-tag { display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 4px; background: var(--brand-bg); color: var(--brand); }
.loader-tag { display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 4px; background: var(--surface-soft); color: var(--text-secondary); }
.col-rank { width: 60px; }
.col-name { }
.col-category { width: 100px; }
.col-loader { width: 80px; }
.col-downloads { width: 100px; text-align: right; }
.col-trend { width: 60px; text-align: center; }

/* ==================== 兼容性检测页面 ==================== */
.compat-page { width: 100%; }
.compat-page-header { margin-bottom: 24px; }
.compat-page-header .section-title { margin-bottom: 4px; }
.compat-page-subtitle { margin: 0; font-size: 13px; color: var(--text-muted); }
.compat-page .layout-split { align-items: stretch; }
.compat-page .card { min-width: 0; }
.compat-page #compat-mods { min-height: 190px; resize: vertical; }
.compat-page #compat-submit { min-height: 44px; }
.compat-page .result-panel { overflow: hidden; overflow-wrap: anywhere; }
.compat-page .result-panel pre,
.compat-page .result-panel code { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ==================== BUG 页面 ==================== */
.bugs-filter-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.bugs-filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bugs-filter-row:first-child { justify-content: space-between; }
.bugs-filter-group { display: flex; align-items: center; gap: 6px; min-width: 0; }
.bugs-filter-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.bugs-severity-tabs { display: flex; gap: 4px; min-width: 0; }
.bugs-severity-tab { display: inline-flex; align-items: center; justify-content: center; padding: 6px 14px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border); background: white; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; text-decoration: none; white-space: nowrap; }
.bugs-severity-tab:hover { border-color: var(--brand); }
.bugs-severity-tab.active { background: var(--brand); color: white; border-color: var(--brand); }
.bugs-filter-select { min-width: 130px; padding: 6px 30px 6px 10px; font-size: 12px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--text); outline: none; }
.bugs-search-box { position: relative; display: flex; align-items: center; min-width: 240px; }
.bugs-search-box > svg { position: absolute; left: 10px; z-index: 1; color: var(--text-muted); pointer-events: none; }
.bugs-search-input { width: 100%; padding: 8px 12px 8px 34px; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--text); outline: none; }
.bugs-search-input:focus { border-color: var(--brand); }
.bugs-total-count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.bugs-list-card { background: white; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }

.bug-filter-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.bug-filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.bug-filter-group { display: flex; align-items: center; gap: 6px; }
.bug-filter-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.bug-severity-tabs { display: flex; gap: 4px; }
.bug-severity-tab { padding: 6px 14px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border); background: white; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; text-decoration: none; }
.bug-severity-tab:hover { border-color: var(--brand); }
.bug-severity-tab.active { background: var(--brand); color: white; border-color: var(--brand); }
.bug-filter-select { padding: 6px 10px; font-size: 12px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--text); outline: none; }
.bug-search-box { display: flex; align-items: center; }
.bug-search-input { padding: 6px 12px; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; background: white; color: var(--text); outline: none; width: 200px; }
.bug-search-input:focus { border-color: var(--brand); }
.bug-total-count { font-size: 13px; color: var(--text-muted); }
.bug-list-card { background: white; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.bug-row { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); text-decoration: none; color: inherit; transition: background 0.15s; gap: 12px; }
.bug-row:hover { background: var(--brand-bg); }
.bug-row:last-child { border-bottom: none; }
.bug-row-info { flex: 1; min-width: 0; }
.bug-row-title { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bug-row-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 12px; }
.bug-row-mods { font-size: 12px; color: var(--text-muted); }
.bug-row-version { }
.bug-row-external { flex-shrink: 0; }
.bug-source-link { font-size: 12px; color: var(--brand); text-decoration: none; }
.bug-source-link:hover { text-decoration: underline; }
.bug-detail-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.bug-detail-mod-tag { display: inline-block; padding: 4px 10px; font-size: 12px; border-radius: 6px; background: var(--surface-soft); color: var(--text-secondary); margin: 2px; }
.bug-back-link { font-size: 13px; color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 16px; }
.bug-back-link:hover { text-decoration: underline; }
.bug-severity-tag-lg { display: inline-block; padding: 4px 12px; font-size: 13px; font-weight: 600; border-radius: 6px; margin-bottom: 12px; }

/* 兼容检测与特性警示：平板/手机适配 */
@media (max-width: 768px) {
    .compat-page .layout-split { grid-template-columns: 1fr; gap: 16px; }
    .compat-page .result-panel { min-height: 180px; }

    .ranking-page { padding: 24px 16px; }
    .bugs-filter-row,
    .bugs-filter-row:first-child { width: 100%; justify-content: flex-start; align-items: stretch; }
    .bugs-filter-group { width: 100%; }
    .bugs-filter-group:has(.bugs-filter-select) { width: auto; }
    .bugs-severity-tabs { flex: 1; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px; }
    .bugs-severity-tabs::-webkit-scrollbar { display: none; }
    .bugs-severity-tab { flex: 0 0 auto; min-height: 36px; padding: 7px 14px; }
    .bugs-search-box { flex: 1 1 240px; min-width: 0; }
    .bugs-total-count { align-self: center; }
    .bug-row { align-items: flex-start; padding: 14px; gap: 10px; }
    .bug-row-title { display: block; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; overflow-wrap: anywhere; }
    .bug-row-meta { flex-wrap: wrap; gap: 4px 10px; line-height: 1.5; }
    .bug-row-mods,
    .bug-row-version { overflow-wrap: anywhere; }
    .ranking-page-pagination { flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .compat-page { padding: 20px 14px; }
    .compat-page-header { margin-bottom: 18px; }
    .compat-page-header .section-title { font-size: 22px; line-height: 1.35; }
    .compat-page-subtitle { font-size: 12px; line-height: 1.6; }
    .compat-page .card { padding: 16px; border-radius: 12px; }
    .compat-page .card-title { margin-bottom: 12px !important; }
    .compat-page #compat-mods { min-height: 170px; font-size: 16px; }
    .compat-page select { min-height: 44px; font-size: 16px; }
    .compat-page #compat-submit { width: 100%; min-height: 46px; }
    .compat-page .result-panel { min-height: 150px; }
    .compat-page .empty-state { padding: 36px 12px; }

    .ranking-page { padding: 20px 12px; }
    .ranking-page-header { margin-bottom: 18px; }
    .ranking-page-header h1 { font-size: 22px; line-height: 1.35; }
    .ranking-page-header p { font-size: 12px; line-height: 1.7; }
    .bugs-filter-bar { gap: 10px; margin-bottom: 14px; }
    .bugs-filter-row { gap: 8px; }
    .bugs-filter-group { flex-direction: column; align-items: stretch; gap: 5px; }
    .bugs-filter-group:has(.bugs-filter-select) { width: 100%; }
    .bugs-filter-label { font-size: 11px; }
    .bugs-filter-select { width: 100%; min-height: 42px; font-size: 16px; }
    .bugs-search-box { flex-basis: 100%; width: 100%; }
    .bugs-search-input { min-height: 44px; font-size: 16px; }
    .bugs-total-count { width: 100%; text-align: right; font-size: 12px; }
    .bugs-list-card { border-radius: 12px; }
    .bug-row { position: relative; flex-wrap: wrap; padding: 14px 12px; gap: 8px; }
    .bug-row .bug-severity-tag { order: 1; }
    .bug-row-info { order: 2; flex-basis: calc(100% - 70px); }
    .bug-row-external { display: none; }
    .bug-row-title { font-size: 14px; font-weight: 600; }
    .bug-row-meta { flex-direction: column; gap: 2px; margin-top: 6px; }
    .bug-row-mods,
    .bug-row-version { font-size: 11px; }
    .ranking-page-pagination { gap: 6px; margin-top: 18px; }
    .ranking-page-pagination a,
    .ranking-page-pagination span,
    .page-btn { min-height: 40px; padding: 8px 12px; }
    .ranking-page-pagination .page-info { flex-basis: 100%; border: none; text-align: center; padding: 4px 0; }
}

/* ==================== 历史记录 ==================== */
.history-header { margin-bottom: 24px; }
.history-title { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.history-subtitle { font-size: 13px; color: var(--text-muted); }
.history-tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--border-soft); border-radius: 10px; width: fit-content; }
.history-tab { padding: 8px 16px; font-size: 13px; border-radius: 8px; border: none; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
.history-tab:hover { color: var(--text); }
.history-tab.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }
.history-tab-label { }
.history-tab-count { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--border-soft); }
.history-tab-remaining { font-size: 11px; color: var(--text-muted); }
.history-panel { }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.history-item-head { display: flex; align-items: center; padding: 12px 16px; cursor: pointer; gap: 12px; }
.history-item-toggle { flex-shrink: 0; }
.history-item-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.history-item-summary { flex: 1; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item-arrow { transition: transform 0.2s; }
.history-item-delete { flex-shrink: 0; padding: 4px 8px; font-size: 12px; color: var(--text-muted); background: none; border: none; cursor: pointer; }
.history-item-delete:hover { color: var(--danger); }
.history-item-body { padding: 0 16px 16px; }
.history-block { margin-bottom: 12px; }
.history-block-title { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; }
.history-code { background: var(--border-soft); padding: 10px 14px; border-radius: 8px; font-size: 12px; font-family: monospace; color: var(--text-secondary); white-space: pre-wrap; word-break: break-all; max-height: 200px; overflow-y: auto; }
.history-empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }

/* ==================== 个人中心 ==================== */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.profile-info-card { }
.profile-section-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.profile-info { }
.profile-info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.profile-info-row:last-child { border-bottom: none; }
.profile-info-row span:first-child { color: var(--text-muted); }
.profile-info-row span:last-child { color: var(--text); font-weight: 500; }
.profile-info-link { color: var(--brand); font-size: 13px; }
.profile-form-card { }
.profile-form { display: flex; flex-direction: column; gap: 14px; }
.profile-hint { font-size: 12px; color: var(--text-muted); }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; display: block; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 2px; }
.form-alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.form-alert.error { background: rgba(192,57,43,0.06); color: var(--danger); }
.form-alert.success { background: rgba(91,156,50,0.06); color: var(--brand); }

/* ==================== 认证页面 (登录/注册/重置密码) ==================== */
.auth-wrap { max-width: 440px; margin: 0 auto; }
.slim { max-width: 440px; }
.auth-links { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-links a { color: var(--brand); }
.auth-submit { width: 100%; }
.auth-state-error { text-align: center; padding: 32px; color: var(--danger); }
.form-agreement { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }

/* ==================== 管理后台 ==================== */
.notice { padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.notice.error { background: rgba(192,57,43,0.06); color: var(--danger); border: 1px solid rgba(192,57,43,0.15); }
.notice.success { background: rgba(91,156,50,0.06); color: var(--brand); border: 1px solid rgba(91,156,50,0.15); }
.login-form { max-width: 400px; }
.admin-settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { padding: 10px 14px; font-size: 13px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.stats-table th { color: var(--text-muted); font-weight: 500; }
.test-result { padding: 12px 16px; border-radius: 8px; font-size: 13px; font-family: monospace; white-space: pre-wrap; }
.test-result.success { background: rgba(91,156,50,0.06); color: var(--brand); }
.test-result.error { background: rgba(192,57,43,0.06); color: var(--danger); }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }

/* ==================== 通用组件 ==================== */
.result-panel { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 20px; min-height: 200px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); font-size: 14px; }
.drag-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.15s; }
.drag-zone:hover { border-color: var(--brand); background: var(--brand-bg); }
/* 拖拽区内的 textarea 不需要自己的边框/背景，融入拖拽区 */
.drag-zone .textarea {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    background: transparent !important;
}
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-option { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s; }
.radio-option:hover { border-color: var(--brand); }
.radio-option input[type="radio"] { width: auto; }
.modcheck-dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 40px; text-align: center; cursor: pointer; transition: all 0.15s; }
.modcheck-dropzone:hover { border-color: var(--brand); background: var(--brand-bg); }
.modcheck-dropzone-text { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.modcheck-dropzone-hint { font-size: 12px; color: var(--text-muted); }
.modcheck-file-info { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-soft); border-radius: 8px; font-size: 13px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface-soft); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-md { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; font-size: 13px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-secondary); text-decoration: none; transition: all 0.15s; }
.page-btn:hover { border-color: var(--brand); color: var(--brand); }
.page-btn.active { background: var(--brand); color: white; border-color: var(--brand); }
.page-btn.disabled { opacity: 0.4; pointer-events: none; }
.page-info { font-size: 13px; color: var(--text-muted); padding: 8px 14px; }

/* 消息出现动画 */
@keyframes msgSlide {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.msg-enter { animation: msgSlide 0.3s ease forwards; }

/* 加载动画点 */
.ai-loading { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.ai-loading-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
    animation: ai-dot-bounce 1.4s ease-in-out infinite;
}
.ai-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ==================== 全局动画增强 ==================== */

/* 无障碍：尊重用户减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* 页面容器入场 */
@keyframes pageReveal {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-main {
    animation: pageReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== 卡片 hover 增强 ==================== */
.card {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand);
}

/* ==================== 按钮交互动画增强 ==================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(91, 156, 50, 0.35);
}
.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 1px 4px rgba(91, 156, 50, 0.2);
}
/* 按钮波纹效果 */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.btn-primary:hover::after {
    opacity: 1;
}

.btn-secondary {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-secondary:hover {
    transform: translateY(-1px);
    border-color: var(--brand);
    color: var(--brand);
}
.btn-secondary:active {
    transform: scale(0.97);
}

/* ==================== 导航链接动画 ==================== */
.navbar .nav-link {
    position: relative;
    transition: color 0.2s ease;
}
.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--brand);
    border-radius: 2px;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.navbar .nav-link:hover::after {
    width: 60%;
    left: 20%;
}

/* ==================== 表单元素动画 ==================== */
input[type="text"], input[type="email"], input[type="password"], textarea, select {
    transition: border-color 0.25s ease,
                box-shadow 0.25s ease,
                transform 0.2s ease;
}
input:focus, textarea:focus, select:focus {
    transform: translateY(-1px);
}

/* ==================== 链接悬浮动画 ==================== */
a:not(.btn-primary):not(.btn-secondary):not(.nav-link):not(.feature-link):not(.rank-item):not(.navbar-brand) {
    transition: color 0.2s ease;
}
a:not(.btn-primary):not(.btn-secondary):not(.nav-link):not(.feature-link):not(.rank-item):not(.navbar-brand):hover {
    color: var(--brand);
}

/* ==================== Feature 卡片增强 ==================== */
.feature-link {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.feature-link:hover {
    transform: translateY(-3px);
    border-color: var(--brand);
    box-shadow: 0 8px 24px rgba(91, 156, 50, 0.12);
}

/* ==================== AOS 兼容覆盖 ==================== */
/* 修复 AOS 在已可见元素上可能产生的问题 */
[data-aos].card,
[data-aos].feature-link,
[data-aos].btn-primary {
    transition-property: transform, opacity, box-shadow, border-color;
}

/* ==================== 骨架屏加载动画 ==================== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg,
        var(--surface-soft) 25%,
        var(--border-soft) 37%,
        var(--surface-soft) 63%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* ==================== 排名列表项动画 ==================== */
.rank-item {
    transition: background 0.2s ease,
                transform 0.2s ease;
}
.rank-item:hover {
    transform: translateX(4px);
}

/* ==================== Footer 链接动画 ==================== */
footer a {
    transition: color 0.2s ease,
                opacity 0.2s ease;
}

/* ==================== Logo 悬浮旋转 ==================== */
.navbar .logo-icon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.navbar:hover .logo-icon {
    transform: rotate(-5deg) scale(1.1);
}

/* ==================== Section 标题装饰动画 ==================== */
@keyframes titleLine {
    from { width: 0; }
    to { width: 32px; }
}
.section-title {
    position: relative;
    padding-bottom: 12px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 3px;
    background: var(--brand);
    border-radius: 2px;
    animation: titleLine 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==================== 用户中心 — Vercel/Linear 专业侧边栏布局 ==================== */
.user-layout {
    display: flex;
    min-height: calc(100vh - 48px - 80px);
    max-width: 1120px;
    margin: 0 auto;
}

/* ---- 侧边栏 ---- */
.user-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: #FAFBFC;
}
.user-sidebar-profile {
    padding: 32px 20px 24px;
}
.user-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, #5B9C32 0%, #3D6B20 100%);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 700; letter-spacing: -0.5px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(91,156,50,0.2);
}
.user-sidebar-name {
    font-size: 16px; font-weight: 600; color: var(--text);
    margin-bottom: 2px; letter-spacing: -0.2px;
}
.user-sidebar-email {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-sidebar-nav {
    flex: 1;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.user-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.user-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 6px;
    font-size: 13px; font-weight: 500; color: var(--text-secondary);
    background: none; border: none; cursor: pointer;
    text-decoration: none; text-align: left; width: 100%;
    transition: background 0.12s, color 0.12s;
    font-family: inherit; line-height: 1.4;
}
.user-nav-item svg { flex-shrink: 0; opacity: 0.65; }
.user-nav-item:hover { background: rgba(0,0,0,0.04); color: var(--text); }
.user-nav-item.active {
    background: rgba(91,156,50,0.06);
    color: #3D6B20;
    font-weight: 600;
}
.user-nav-item.active svg { opacity: 1; color: var(--brand); }
.user-nav-badge {
    margin-left: auto; font-size: 11px; min-width: 20px; height: 20px;
    line-height: 20px; text-align: center;
    border-radius: 10px; padding: 0 7px;
    background: rgba(0,0,0,0.06); color: var(--text-muted);
    font-weight: 500;
}
.user-nav-item.active .user-nav-badge {
    background: rgba(91,156,50,0.1); color: #3D6B20;
}
.user-sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-soft);
    display: flex; flex-direction: column; gap: 2px;
}
.user-sidebar-foot-link {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 6px;
    font-size: 12px; color: var(--text-muted);
    background: none; border: none; cursor: pointer;
    text-decoration: none; transition: color 0.12s;
    font-family: inherit;
}
.user-sidebar-foot-link:hover { color: var(--text-secondary); }
.user-logout-btn:hover { color: var(--danger); }

/* ---- 内容区 ---- */
.user-content {
    flex: 1; min-width: 0;
    padding: 40px 48px;
}

/* ---- 页面标题 ---- */
.user-page-header {
    margin-bottom: 32px;
}
.user-page-header h2 {
    font-size: 24px; font-weight: 700; color: var(--text);
    margin: 0 0 6px; letter-spacing: -0.3px;
}
.user-page-header p {
    font-size: 14px; color: var(--text-muted); margin: 0;
}

/* ---- 概览 Banner ---- */
.user-banner {
    display: flex; align-items: center; gap: 20px;
    padding: 24px 28px; margin-bottom: 32px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}
.user-banner-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #5B9C32 0%, #3D6B20 100%);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(91,156,50,0.25);
}
.user-banner-text { flex: 1; min-width: 0; }
.user-banner-greeting {
    font-size: 22px; font-weight: 700; color: var(--text);
    margin: 0 0 4px; letter-spacing: -0.3px;
}
.user-banner-meta {
    font-size: 13px; color: var(--text-muted); margin: 0;
}
.user-banner-actions { flex-shrink: 0; }

/* ---- 统计卡片 ---- */
.user-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 36px;
}
.user-stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex; align-items: flex-start; gap: 14px;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.user-stat-card:hover {
    border-color: #D4D0C8;
    box-shadow: var(--shadow-md);
}
.user-stat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-stat-icon--green  { background: #ECF8E8; color: #5B9C32; }
.user-stat-icon--blue   { background: #E8F0FE; color: #4A80D9; }
.user-stat-icon--amber  { background: #FEF3E5; color: #D4843E; }
.user-stat-icon--purple { background: #F3EBFA; color: #7C3AED; }
.user-stat-body { flex: 1; min-width: 0; }
.user-stat-value {
    font-size: 24px; font-weight: 700; color: var(--text);
    line-height: 1.3; letter-spacing: -0.3px;
}
.user-stat-value--small {
    font-size: 12px; font-weight: 500; color: var(--text-secondary);
    line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-stat-label {
    font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

/* ---- 区块标题 ---- */
.user-section {
    margin-bottom: 32px;
}
.user-section-title {
    font-size: 15px; font-weight: 600; color: var(--text);
    margin: 0 0 16px; letter-spacing: -0.1px;
}

/* ---- 快捷链接 ---- */
.user-quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.user-quick-link {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; border-radius: 10px;
    background: white; border: 1px solid var(--border);
    font-size: 14px; font-weight: 500; color: var(--text-secondary);
    text-decoration: none;
    transition: border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.user-quick-link svg { flex-shrink: 0; opacity: 0.5; }
.user-quick-link:hover {
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 2px 8px rgba(91,156,50,0.08);
}
.user-quick-link:hover svg { opacity: 1; }

/* ---- 下划线 Tabs ---- */
.user-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}
.user-tab {
    padding: 10px 20px; font-size: 14px; font-weight: 500;
    color: var(--text-muted); background: none; border: none;
    border-bottom: 2px solid transparent; cursor: pointer;
    font-family: inherit; transition: color 0.12s, border-color 0.12s;
    margin-bottom: -1px; display: flex; align-items: center; gap: 8px;
}
.user-tab:hover { color: var(--text); }
.user-tab.active {
    color: var(--text); font-weight: 600;
    border-bottom-color: var(--text);
}
.user-tab-count {
    font-size: 11px; padding: 0 7px; height: 18px; line-height: 18px;
    border-radius: 9px; background: rgba(0,0,0,0.06); color: var(--text-muted);
}
.user-tab.active .user-tab-count {
    background: rgba(0,0,0,0.08); color: var(--text-secondary);
}

/* ---- 空状态 ---- */
.user-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 64px 24px;
    background: white; border: 1px solid var(--border); border-radius: 12px;
    color: var(--text-muted); text-align: center;
}
.user-empty svg { margin-bottom: 16px; opacity: 0.3; }
.user-empty p { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--text-secondary); }
.user-empty span { font-size: 13px; }

/* ---- 按钮系统（用户中心专用） ---- */
.user-btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; font-size: 13px; font-weight: 600; color: white;
    background: var(--brand); border: none; border-radius: 8px; cursor: pointer;
    transition: background 0.12s; font-family: inherit; text-decoration: none;
}
.user-btn-primary:hover { background: var(--brand-dark); }
.user-btn-outline {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; font-size: 13px; font-weight: 500; color: var(--text);
    background: white; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
    transition: all 0.12s; font-family: inherit; text-decoration: none;
}
.user-btn-outline:hover { border-color: #C0BDB5; background: var(--surface-soft); }
.user-btn-ghost {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 12px; font-size: 12px; font-weight: 500; color: var(--text-muted);
    background: none; border: none; border-radius: 6px; cursor: pointer;
    transition: all 0.12s; font-family: inherit; text-decoration: none;
}
.user-btn-ghost:hover { background: rgba(0,0,0,0.04); color: var(--danger); }
.user-btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }

/* ---- 设置卡片 ---- */
.user-setting-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 28px;
    margin-bottom: 16px;
}
.user-setting-title {
    font-size: 15px; font-weight: 600; color: var(--text);
    margin: 0 0 20px; letter-spacing: -0.1px;
}
.user-info-grid {
    display: flex; flex-direction: column;
}
.user-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--border-soft);
}
.user-info-row:last-child { border-bottom: none; }
.user-info-label { font-size: 13px; color: var(--text-muted); }
.user-info-value { font-size: 14px; font-weight: 500; color: var(--text); }

/* ---- 表单 ---- */
.user-form-row {
    display: flex; gap: 16px; align-items: flex-end;
}
.user-form-field { flex: 1; }
.user-form-label {
    display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary);
    margin-bottom: 6px;
}
.user-input {
    width: 100%; padding: 9px 12px; font-size: 14px;
    border: 1px solid var(--border); border-radius: 8px;
    background: white; color: var(--text); outline: none;
    transition: border-color 0.12s, box-shadow 0.12s;
    font-family: inherit;
}
.user-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-bg);
}
.user-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.user-form-actions {
    display: flex; justify-content: flex-end;
}

/* ---- 对话列表 ---- */
.user-conv-list {
    display: flex; flex-direction: column; gap: 6px;
}
.user-conv-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.user-conv-item:hover {
    border-color: #D4D0C8;
    box-shadow: var(--shadow-sm);
}
.user-conv-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--surface-soft);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; color: var(--text-muted);
}
.user-conv-info { flex: 1; min-width: 0; }
.user-conv-title {
    font-size: 14px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-conv-meta {
    font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.user-conv-actions {
    display: flex; gap: 8px; flex-shrink: 0;
}

/* ---- 工具历史列表 ---- */
.history-list {
    display: flex; flex-direction: column; gap: 4px;
}
.history-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.12s;
}
.history-item:hover {
    border-color: #D4D0C8;
}
.history-item-main {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; cursor: pointer;
    transition: background 0.1s;
}
.history-item-main:hover { background: var(--surface-soft); }
.history-item-info {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 18px;
}
.history-item-date {
    font-size: 12px; color: var(--text-muted); flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.history-item-summary {
    font-size: 14px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-item-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.history-item-delete {
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 6px;
    border: none; background: none; color: var(--text-muted);
    cursor: pointer; opacity: 0; transition: opacity 0.12s, background 0.12s;
}
.history-item:hover .history-item-delete { opacity: 1; }
.history-item-delete:hover { background: rgba(192,57,43,0.08); color: var(--danger); }
.history-item-chevron {
    flex-shrink: 0; color: var(--text-muted);
    transition: transform 0.2s;
}
.history-item-body {
    border-top: 1px solid var(--border-soft);
    padding: 16px 20px;
    background: #FAFBFC;
    display: flex; flex-direction: column; gap: 16px;
}
.history-block { }
.history-block-label {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.history-code {
    margin: 0; padding: 12px 14px;
    background: white; border: 1px solid var(--border);
    border-radius: 8px; font-size: 12px; line-height: 1.6;
    color: var(--text); font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    white-space: pre-wrap; word-break: break-all; overflow-x: auto;
    max-height: 280px; overflow-y: auto;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    .user-layout { flex-direction: column; }
    .user-sidebar {
        width: 100%; border-right: none; border-bottom: 1px solid var(--border);
        padding: 16px; flex-direction: column; gap: 8px;
    }
    .user-sidebar-profile { padding: 0; display: flex; align-items: center; gap: 12px; }
    .user-avatar { width: 36px; height: 36px; font-size: 16px; margin-bottom: 0; }
    .user-sidebar-nav { flex-direction: row; padding: 0; gap: 8px; }
    .user-sidebar-section { flex-direction: row; }
    .user-sidebar-footer { flex-direction: row; border-top: none; padding: 0; gap: 8px; }
    .user-nav-badge { display: none; }
    .user-content { padding: 20px 16px; }
    .user-stats-row { grid-template-columns: repeat(2, 1fr); }
    .user-quick-links { grid-template-columns: repeat(2, 1fr); }
    .user-form-grid { grid-template-columns: 1fr; }
    .user-banner { flex-wrap: wrap; }
    .user-banner-actions { width: 100%; }
    .user-tabs { overflow-x: auto; }
}

/* ==================== API 文档页 ==================== */
.docs-layout {
    display: flex;
    min-height: calc(100vh - 56px - 100px);
    max-width: 1200px;
    margin: 0 auto;
}
.docs-sidebar {
    width: 220px; flex-shrink: 0;
    padding: 40px 0 24px;
    border-right: 1px solid var(--border);
    background: #FAFBFC;
    position: sticky; top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}
.docs-sidebar-title {
    font-size: 13px; font-weight: 700; color: var(--text);
    padding: 0 20px 16px; margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.docs-nav {
    display: flex; flex-direction: column; gap: 1px;
    padding: 0 12px;
}
.docs-nav-item {
    display: block; padding: 7px 12px; border-radius: 6px;
    font-size: 13px; color: var(--text-secondary); text-decoration: none;
    transition: background 0.1s, color 0.1s;
}
.docs-nav-item:hover { background: rgba(0,0,0,0.04); color: var(--text); }
.docs-nav-item.active {
    background: rgba(91,156,50,0.06); color: #3D6B20; font-weight: 600;
}

.docs-content {
    flex: 1; min-width: 0;
    padding: 40px 48px;
}
.docs-section {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border-soft);
}
.docs-section:last-child { border-bottom: none; margin-bottom: 0; }
.docs-section h1 {
    font-size: 28px; font-weight: 700; color: var(--text);
    margin: 0 0 12px; letter-spacing: -0.5px;
}
.docs-section h2 {
    font-size: 22px; font-weight: 700; color: var(--text);
    margin: 0 0 16px; padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    letter-spacing: -0.3px;
}
.docs-section h3 {
    font-size: 16px; font-weight: 600; color: var(--text);
    margin: 28px 0 10px;
}
.docs-section p {
    font-size: 14px; color: var(--text-secondary); line-height: 1.8;
    margin: 0 0 12px;
}
.docs-section p code {
    background: var(--border-soft); padding: 1px 6px;
    border-radius: 4px; font-size: 13px; color: var(--text);
}
.docs-table {
    width: 100%; border-collapse: collapse;
    margin: 16px 0; font-size: 13px;
}
.docs-table th, .docs-table td {
    text-align: left; padding: 10px 14px;
    border-bottom: 1px solid var(--border-soft);
}
.docs-table th {
    font-weight: 600; color: var(--text); background: var(--surface-soft);
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px;
}
.docs-table td { color: var(--text-secondary); }
.docs-table td code { background: var(--border-soft); padding: 1px 6px; border-radius: 3px; font-size: 12px; color: var(--text); }

.docs-code-block {
    margin: 16px 0; border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden;
    background: #1A1C1E;
}
.docs-code-label {
    padding: 8px 14px; font-size: 11px; font-weight: 600;
    color: var(--text-muted); background: #F5F2EB;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.3px;
}
.docs-code-block pre {
    margin: 0; padding: 16px;
    overflow-x: auto;
}
.docs-code-block code {
    font-family: "SF Mono", "Fira Code", "Consolas", monospace;
    font-size: 13px; line-height: 1.7; color: #E5E7EB;
    background: none; padding: 0;
}

.docs-callout {
    padding: 14px 18px; margin: 16px 0;
    background: #EBF5FF; border: 1px solid #BFDBFE;
    border-radius: 8px; font-size: 13px; color: #1E40AF; line-height: 1.6;
}
.docs-callout-warn {
    background: #FFF7ED; border-color: #FED7AA; color: #C2410C;
}

@media (max-width: 768px) {
    .docs-layout { flex-direction: column; }
    .docs-sidebar {
        width: 100%; border-right: none; border-bottom: 1px solid var(--border);
        position: static; height: auto; padding: 12px 12px 0;
    }
    .docs-sidebar-title { padding: 0 4px 8px; margin-bottom: 0; font-size: 14px; }
    .docs-nav {
        flex-direction: row; flex-wrap: nowrap; gap: 4px; padding: 0 0 8px;
        overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .docs-nav::-webkit-scrollbar { display: none; }
    .docs-nav-item { font-size: 12px; padding: 5px 10px; white-space: nowrap; flex-shrink: 0; }
    .docs-content { padding: 16px 12px; }
    .docs-section { padding: 16px 0; }
    .docs-section h1 { font-size: 20px; }
    .docs-section h2 { font-size: 17px; }
    .docs-section h3 { font-size: 14px; }
    .docs-section p { font-size: 13px; line-height: 1.7; }
    /* 表格横向滚动 */
    .docs-table {
        display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
        white-space: nowrap; font-size: 12px;
    }
    .docs-table th, .docs-table td { padding: 8px 10px; font-size: 12px; }
    /* 代码块 */
    .docs-code-block { margin: 12px 0; }
    .docs-code-block pre { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .docs-code-block code { font-size: 12px; line-height: 1.5; }
    .docs-code-label { font-size: 10px; padding: 6px 10px; }
    /* callout */
    .docs-callout { padding: 10px 14px; font-size: 12px; }
}
@media (max-width: 480px) {
    .docs-sidebar { padding: 8px 8px 0; }
    .docs-nav-item { font-size: 11px; padding: 4px 8px; }
    .docs-content { padding: 12px 8px; }
    .docs-section h1 { font-size: 18px; }
    .docs-section h2 { font-size: 15px; }
    .docs-section p { font-size: 13px; }
    .docs-code-block code { font-size: 11px; }
    .docs-table { font-size: 11px; }
    .docs-table th, .docs-table td { padding: 6px 8px; font-size: 11px; }
}

/* ==================== 全局移动端适配（768px 以下） ==================== */
@media (max-width: 768px) {
    /* ---- 登录/注册/重置密码 ---- */
    .auth-wrap { padding: 20px 12px; }
    .auth-card { padding: 24px 20px; border-radius: 12px; }
    .auth-card h2 { font-size: 20px; }
    .auth-card .form-group { margin-bottom: 14px; }
    .auth-card input[type="text"],
    .auth-card input[type="email"],
    .auth-card input[type="password"] {
        padding: 12px 14px; font-size: 16px; min-height: 44px;
    }
    .auth-card .btn-primary { width: 100%; padding: 12px; font-size: 15px; }
    .auth-card .form-label { font-size: 14px; }
    .auth-footer { padding: 12px; font-size: 13px; }

    /* OAuth 按钮手机端 */
    .oauth-buttons { gap: 8px; }
    .oauth-btn { padding: 8px 14px; min-width: 64px; }
    .oauth-btn svg { width: 22px; height: 22px; }

    /* ---- 工具页（compat/diagnose/recommend/modcheck/calculator/java）---- */
    .page-main { padding: 16px 12px; }
    .page-main .card { padding: 16px; border-radius: 12px; }
    .page-main h1 { font-size: 20px; }
    .page-main h2 { font-size: 17px; }
    .page-main textarea,
    .page-main select,
    .page-main input[type="text"],
    .page-main input[type="number"],
    .page-main input[type="email"] {
        font-size: 16px; padding: 12px 14px; min-height: 44px;
    }
    .page-main .btn-primary,
    .page-main .btn-secondary,
    .page-main button[type="submit"] {
        width: 100%; padding: 12px; font-size: 15px;
    }
    .tool-result { margin-top: 16px; padding: 16px; }

    /* ---- BUG 列表/详情 ---- */
    .bugs-list { padding: 12px 0; }
    .bug-row { padding: 12px; flex-wrap: wrap; gap: 8px; }
    .bug-row .bug-severity { order: -1; width: 100%; }
    .bug-detail-header { flex-direction: column; gap: 12px; }
    .bug-detail-header h1 { font-size: 18px; }
    .bug-detail-section { padding: 12px; }

    /* ---- 模组/光影详情 ---- */
    .mod-hero { padding: 24px 16px; flex-direction: column; align-items: flex-start; gap: 16px; }
    .mod-hero img { width: 56px; height: 56px; }
    .mod-detail-grid { grid-template-columns: 1fr; gap: 12px; }
    .mod-detail-card { padding: 16px; }

    /* ---- 排行榜表格 → 卡片式 ---- */
    .ranking-page-table { display: block; overflow-x: auto; }
    .ranking-table-wrapper { margin: 0 -16px; }

    /* ---- 历史记录 ---- */
    .history-container { padding: 12px; }
    .history-tabs { flex-wrap: wrap; gap: 4px; }
    .history-tab { font-size: 13px; padding: 8px 14px; }

    /* ---- 推荐页 ---- */
    .recommend-grid { grid-template-columns: 1fr; gap: 12px; }
    .recommend-card { padding: 16px; }

    /* ---- 引导页 ---- */
    .guide-content { padding: 16px 12px; }
    .guide-content h1 { font-size: 20px; }
    .guide-content h2 { font-size: 17px; }
    .guide-content h3 { font-size: 15px; }
    .guide-content p, .guide-content li { font-size: 14px; }
    .guide-content pre,
    .guide-content code { font-size: 13px; padding: 10px; }
    .guide-content img { max-width: 100%; height: auto; }

    /* ---- 404 ---- */
    .error-page { padding: 48px 16px; text-align: center; }
    .error-page h1 { font-size: 48px; }
    .error-page p { font-size: 15px; }
    .error-page .btn { padding: 12px 24px; font-size: 15px; }

    /* ---- 法律信息 ---- */
    .legal-content { padding: 20px 16px; }
    .legal-content h1 { font-size: 20px; }
    .legal-content h2 { font-size: 17px; }
    .legal-content p, .legal-content li { font-size: 14px; line-height: 1.8; }

    /* ---- 通用卡片/列表 ---- */
    .card { padding: 16px; border-radius: 12px; }

    /* ---- 表单全局触控优化 ---- */
    button, a.btn, .btn, [type="submit"], [type="button"] { min-height: 40px; }

    /* ---- Footer ---- */
    footer { padding: 32px 0 20px; }
    footer .grid { gap: 24px; }
}

/* ==================== 小屏手机（480px 以下） ==================== */
@media (max-width: 480px) {
    .auth-wrap { padding: 12px 8px; }
    .auth-card { padding: 20px 16px; }
    .auth-card h2 { font-size: 18px; }
    .page-main h1 { font-size: 18px; }
    .page-main h2 { font-size: 16px; }

    .hero h1 { font-size: 26px; }
    .hero p { font-size: 13px; }
    .hero .text-sm { font-size: 11px; }
    .hero { min-height: auto !important; padding: 80px 0 40px !important; }

    .feature-link { padding: 10px; }
    .feature-link .font-semibold { font-size: 12px; }
    .feature-link .text-xs { font-size: 10px; }

    .rank-item { padding: 8px 10px; gap: 6px; }
    .rank-item-name { font-size: 12px; }
    .rank-item-downloads { font-size: 12px; width: 50px; }
    .rank-number { width: 32px; font-size: 12px; }

    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}