/* ==========================================================================
   云朵TK — 设计系统
   ========================================================================== */

:root {
    --bg:            #f2f5fb;
    --bg-deep:       #e8edf7;
    --surface:       #ffffff;
    --surface-soft:  #f8fafc;
    --border:        #e6ebf4;
    --border-strong: #d6dfee;

    --ink:           #0f172a;
    --ink-soft:      #334155;
    --muted:         #6b7a90;
    --muted-light:   #94a3b8;

    --primary:       #fe2c55;
    --primary-deep:  #e11d48;
    --primary-soft:  #fff1f4;
    --accent:        #25f4ee;
    --accent-deep:   #0d9488;
    --accent-soft:   #eefdfc;

    --success:       #10b981;
    --success-soft:  #ecfdf5;
    --warning:       #f59e0b;
    --warning-soft:  #fffbeb;
    --danger:        #ef4444;
    --danger-soft:   #fef2f2;
    --info:          #3b82f6;
    --info-soft:     #eff6ff;

    --gradient: linear-gradient(120deg, #25f4ee 0%, #6d8cff 45%, #fe2c55 100%);

    --radius-sm: 8px;
    --radius:    14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
    --shadow:    0 8px 24px rgba(15, 23, 42, .08);
    --shadow-lg: 0 18px 48px rgba(15, 23, 42, .12);
    --shadow-island: 0 12px 40px rgba(15, 23, 42, .10), 0 2px 8px rgba(15, 23, 42, .04);

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
            'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

    --nav-h: 68px;
    --shell-gap: 18px;
    --sidebar-w: 236px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }

::selection { background: rgba(254, 44, 85, .16); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mono { font-family: var(--mono); }

/* ==========================================================================
   通用组件
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease,
                border-color .16s ease, color .16s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(254, 44, 85, .28);
}
.btn-primary:hover { background: var(--primary-deep); box-shadow: 0 10px 24px rgba(254, 44, 85, .34); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1e293b; }

.btn-ghost {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-soft { background: var(--surface-soft); border-color: var(--border); color: var(--ink-soft); }
.btn-soft:hover { background: #fff; border-color: var(--border-strong); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 7px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 10px; }

/* 表单 */
.field { margin-bottom: 16px; }

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.field .hint { margin-top: 6px; font-size: 12px; color: var(--muted-light); line-height: 1.5; }

.input, .select, .textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.input::placeholder, .textarea::placeholder { color: var(--muted-light); }

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(254, 44, 85, .12);
}

.textarea { resize: vertical; min-height: 100px; }

.input-group { position: relative; }
.input-group .input { padding-left: 40px; }
.input-group .input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-light);
    pointer-events: none;
    display: flex;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7a90' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-success { background: var(--success-soft); color: #047857; }
.badge-danger  { background: var(--danger-soft);  color: #b91c1c; }
.badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-info    { background: var(--info-soft);    color: #1d4ed8; }
.badge-muted   { background: #f1f5f9;             color: var(--muted); }
.badge-primary { background: var(--primary-soft); color: var(--primary-deep); }

.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* 卡片 */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.card-head h3 { font-size: 15px; }
.card-head .sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.card-body { padding: 22px; }
.card-body.tight { padding: 14px; }

/* 提示条 */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.alert svg { flex-shrink: 0; margin-top: 2px; }
.alert-error   { background: var(--danger-soft);  color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: var(--success-soft); color: #047857; border: 1px solid #a7f3d0; }
.alert-info    { background: var(--info-soft);    color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: var(--warning-soft); color: #b45309; border: 1px solid #fde68a; }

/* ==========================================================================
   前台导航
   ========================================================================== */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 60;
    height: var(--nav-h);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--border);
}

.site-nav .inner {
    max-width: 1280px;
    height: 100%;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient);
    display: grid;
    place-items: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(109, 140, 255, .32);
    flex-shrink: 0;
}

.brand-name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.brand-name .tk {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 中间导航：以中心为基准向两侧展开 */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-self: center;
}

.nav-links a {
    padding: 8px 15px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    transition: color .16s ease, background .16s ease;
    white-space: nowrap;
}

.nav-links a:hover { color: var(--primary); background: var(--primary-soft); }
.nav-links a.active { color: var(--primary); background: var(--primary-soft); }

.nav-actions { display: flex; align-items: center; gap: 10px; justify-self: end; }

/* 语言切换：地球图标 + 语言名，当前语言高亮 */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px 0 9px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface-soft);
    color: var(--muted-light);
}

.lang-switch .lang-item {
    padding: 4px 9px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: all .16s ease;
    white-space: nowrap;
}

.lang-switch .lang-item:hover { color: var(--ink-soft); background: var(--surface); }

.lang-switch .lang-item.active {
    color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ink-soft);
}

/* ==========================================================================
   首页
   ========================================================================== */

.home-main { max-width: 1280px; margin: 0 auto; padding: 0 28px; }

.hero-wrap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 56px;
    align-items: center;
    padding: 60px 0 52px;
}

/* 云朵背景 */
.hero-wrap::before,
.hero-wrap::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .5;
    z-index: -1;
    pointer-events: none;
}

.hero-wrap::before {
    width: 520px; height: 520px;
    top: -140px; left: -180px;
    background: radial-gradient(circle, rgba(37, 244, 238, .38), transparent 68%);
}

.hero-wrap::after {
    width: 460px; height: 460px;
    bottom: -180px; right: -120px;
    background: radial-gradient(circle, rgba(254, 44, 85, .28), transparent 68%);
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    border-radius: 99px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 22px;
}

.hero-tag .pill {
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--gradient);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.hero-title {
    font-size: clamp(32px, 4.2vw, 50px);
    line-height: 1.16;
    letter-spacing: -.03em;
    margin-bottom: 20px;
}

.hero-title .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-desc {
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--muted);
    max-width: 540px;
    margin-bottom: 30px;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 32px;
    max-width: 560px;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(8px);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}

.feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--primary);
}

.feature:nth-child(2n) .feature-icon { background: var(--accent-soft); color: var(--accent-deep); }
.feature:nth-child(3n) .feature-icon { background: var(--info-soft); color: var(--info); }

.feature-title { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.feature-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.hero-stats {
    display: flex;
    gap: 34px;
    padding-top: 26px;
    border-top: 1px dashed var(--border-strong);
    max-width: 560px;
}

.hero-stat .num {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.02em;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-stat .label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* 登录卡片 */
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 34px 32px 30px;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--gradient);
}

.login-card h2 { font-size: 22px; letter-spacing: -.02em; }

.login-eyebrow {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin: 6px 0 26px;
}

.login-card .field { margin-bottom: 15px; }

.login-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -4px 0 20px;
    font-size: 13px;
}

.login-extra a { color: var(--muted); }
.login-extra a:hover { color: var(--primary); }

.login-foot {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.login-foot a { color: var(--primary); font-weight: 600; }

.login-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px dashed var(--border-strong);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* 首页能力条 */
.home-section { padding: 0 0 88px; }

.section-head { text-align: center; max-width: 620px; margin: 0 auto 42px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 15px; line-height: 1.8; }

.capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.capability {
    padding: 28px 26px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform .2s ease, box-shadow .2s ease;
}

.capability:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.capability-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--gradient);
    color: #fff;
    margin-bottom: 18px;
    box-shadow: 0 8px 20px rgba(109, 140, 255, .3);
}

.capability h3 { font-size: 16px; margin-bottom: 9px; }
.capability p { font-size: 13.5px; color: var(--muted); line-height: 1.8; }

/* ==========================================================================
   页脚 & 静态页
   ========================================================================== */

.site-foot {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 40px 0 32px;
}

.site-foot .inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.foot-links { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-links a:hover { color: var(--primary); }
.foot-copy { font-size: 12.5px; color: var(--muted-light); }

.page-shell {
    max-width: 880px;
    margin: 0 auto;
    padding: 56px 28px 88px;
}

.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.02em; margin-bottom: 12px; }
.page-head .meta { font-size: 13px; color: var(--muted-light); }

.prose {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: var(--shadow-sm);
}

.prose h2 {
    font-size: 17px;
    margin: 32px 0 12px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    line-height: 1.4;
}

.prose h2:first-child { margin-top: 0; }
.prose p { font-size: 14px; line-height: 1.95; color: var(--ink-soft); margin-bottom: 12px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { font-size: 14px; line-height: 1.95; color: var(--ink-soft); margin-bottom: 6px; }
.prose strong { color: var(--ink); }
.prose .updated {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-strong);
    font-size: 12.5px;
    color: var(--muted-light);
}

.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }

.contact-item {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.contact-item .icon {
    width: 42px; height: 42px;
    margin: 0 auto 12px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.contact-item .label { font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.contact-item .value { font-size: 14px; font-weight: 700; word-break: break-all; }

/* ==========================================================================
   后台外壳（悬浮岛式侧边栏）
   ========================================================================== */

.shell { min-height: 100vh; padding: var(--shell-gap); display: flex; gap: var(--shell-gap); }

/* —— 悬浮岛侧边栏 —— */
.island {
    position: fixed;
    top: var(--shell-gap);
    left: var(--shell-gap);
    bottom: var(--shell-gap);
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-island);
    padding: 20px 14px 14px;
    z-index: 50;
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.island-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px 18px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.island-brand .brand-logo { width: 38px; height: 38px; border-radius: 11px; }
.island-brand .name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.island-brand .role { font-size: 11px; color: var(--muted-light); margin-top: 1px; }

.island-nav { flex: 1; overflow-y: auto; padding: 4px 2px; }
.island-nav::-webkit-scrollbar { width: 4px; }
.island-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border: none; border-radius: 99px; }

.island-label {
    padding: 14px 10px 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-light);
}

.island-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    position: relative;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.island-link svg { flex-shrink: 0; opacity: .78; }
.island-link:hover { background: var(--surface-soft); color: var(--ink); transform: translateX(2px); }

.island-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(254, 44, 85, .12);
}

.island-link.active svg { opacity: 1; }

.island-link .count {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 99px;
    background: #f1f5f9;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.island-link.active .count { background: #fff; color: var(--primary); }

.island-foot { padding-top: 12px; border-top: 1px solid var(--border); }

.island-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 11px;
    background: var(--surface-soft);
    margin-bottom: 7px;
}

.island-user .avatar {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--gradient);
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 13px;
    flex-shrink: 0;
}

.island-user .info { min-width: 0; }
.island-user .info .n { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.island-user .info .r { font-size: 11px; color: var(--muted-light); }

/* —— 主内容区 —— */
.main {
    flex: 1;
    min-width: 0;
    margin-left: calc(var(--sidebar-w) + var(--shell-gap));
    display: flex;
    flex-direction: column;
    gap: var(--shell-gap);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: var(--shell-gap);
    z-index: 40;
}

.topbar h1 { font-size: 18px; letter-spacing: -.02em; }
.topbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--success-soft);
    color: #047857;
    font-size: 12px;
    font-weight: 600;
}

.live-dot .pulse {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .45; transform: scale(.8); }
}

.content { padding-bottom: var(--shell-gap); display: flex; flex-direction: column; gap: var(--shell-gap); }

.page-menu-btn {
    display: none;
    width: 40px; height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: #fff;
    align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--ink-soft);
}

.island-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .38);
    backdrop-filter: blur(2px);
    z-index: 45;
}

.island-mask.show { display: block; }

/* ==========================================================================
   数据看板
   ========================================================================== */

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat {
    position: relative;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.stat::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: var(--primary-soft);
    opacity: .55;
}

.stat.accent::after { background: var(--accent-soft); }
.stat.info::after   { background: var(--info-soft); }
.stat.success::after{ background: var(--success-soft); }
.stat.warning::after{ background: var(--warning-soft); }

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.stat-icon {
    width: 38px; height: 38px;
    border-radius: 11px;
    display: grid; place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
}

.stat.accent .stat-icon   { background: var(--accent-soft); color: var(--accent-deep); }
.stat.info .stat-icon     { background: var(--info-soft); color: var(--info); }
.stat.success .stat-icon  { background: var(--success-soft); color: #047857; }
.stat.warning .stat-icon  { background: var(--warning-soft); color: #b45309; }

.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; position: relative; z-index: 1; }

.stat-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    position: relative;
    z-index: 1;
}

.stat-foot {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted-light);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.stat-foot .up { color: var(--success); font-weight: 700; }
.stat-foot .down { color: var(--danger); font-weight: 700; }

.value-flash { animation: flash .7s ease; }

@keyframes flash {
    0%   { color: var(--primary); }
    100% { color: inherit; }
}

/* 迷你趋势图 */
.spark { display: flex; align-items: flex-end; gap: 4px; height: 46px; margin-top: 16px; }

.spark .bar {
    flex: 1;
    min-width: 3px;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
    opacity: .82;
    transition: opacity .18s ease, height .4s cubic-bezier(.4, 0, .2, 1);
    min-height: 3px;
}

.spark .bar:hover { opacity: 1; }

.chart-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: var(--muted-light);
}

/* 进度条 */
.meter { margin-top: 14px; }

.meter-head {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 7px;
    color: var(--muted);
}

.meter-head b { color: var(--ink); font-variant-numeric: tabular-nums; }

.meter-track {
    height: 8px;
    border-radius: 99px;
    background: #eef2f9;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--gradient);
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.meter-fill.warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.meter-fill.danger { background: linear-gradient(90deg, #f87171, #ef4444); }

/* ==========================================================================
   表格 / 列表
   ========================================================================== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 260px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box { position: relative; width: 280px; max-width: 100%; }

.search-box .input { padding-left: 38px; height: 40px; }

.search-box .input-icon {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted-light);
    pointer-events: none;
    display: flex;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-scroll { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; min-width: 820px; }

table.data th {
    padding: 13px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    letter-spacing: .02em;
}

table.data td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--ink-soft);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

table.data tbody tr { transition: background .14s ease; }
table.data tbody tr:hover { background: #fafbfe; }
table.data tbody tr:last-child td { border-bottom: none; }

table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.center, table.data th.center { text-align: center; }

.cell-idx { color: var(--muted-light); font-variant-numeric: tabular-nums; font-size: 13px; }

.cell-user { display: flex; align-items: center; gap: 10px; }

.avatar-sm {
    width: 34px; height: 34px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--surface-soft);
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.avatar-fallback {
    width: 34px; height: 34px;
    border-radius: 10px;
    display: grid; place-items: center;
    background: var(--gradient);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.cell-user .meta { min-width: 0; }
.cell-user .meta .n { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.cell-user .meta .s { font-size: 11.5px; color: var(--muted-light); font-family: var(--mono); }

.thumb {
    width: 46px; height: 62px;
    border-radius: 9px;
    object-fit: cover;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.thumb-empty {
    width: 46px; height: 62px;
    border-radius: 9px;
    background: var(--surface-soft);
    border: 1px dashed var(--border-strong);
    display: grid; place-items: center;
    color: var(--muted-light);
    flex-shrink: 0;
}

.link-cell {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    border-bottom: 1px dashed rgba(254, 44, 85, .4);
    font-variant-numeric: tabular-nums;
    transition: opacity .16s ease;
}

.link-cell:hover { opacity: .7; }

.row-actions { display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; }

.empty-state { padding: 64px 24px; text-align: center; }

.empty-state .icon {
    width: 62px; height: 62px;
    margin: 0 auto 18px;
    border-radius: 18px;
    display: grid; place-items: center;
    background: var(--surface-soft);
    color: var(--muted-light);
}

.empty-state h3 { font-size: 15px; margin-bottom: 7px; }
.empty-state p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* 分页 */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-wrap: wrap;
}

.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-info b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pager-list { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.pager-list a, .pager-list span {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    border: 1px solid var(--border);
    background: var(--surface);
    font-variant-numeric: tabular-nums;
    transition: all .16s ease;
}

.pager-list a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.pager-list .current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(254, 44, 85, .28);
}

.pager-list .disabled { opacity: .42; cursor: not-allowed; }
.pager-list .dots { border: none; background: none; color: var(--muted-light); }

/* ==========================================================================
   弹窗
   ========================================================================== */

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.modal-mask.show { opacity: 1; visibility: visible; }

.modal {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 48px);
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateY(14px) scale(.97);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}

.modal-mask.show .modal { transform: translateY(0) scale(1); }
.modal.modal-lg { max-width: 620px; }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 { font-size: 16.5px; }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.modal-close {
    width: 32px; height: 32px;
    border: none;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--muted);
    cursor: pointer;
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: background .16s ease, color .16s ease;
}

.modal-close:hover { background: var(--danger-soft); color: var(--danger); }

.modal-body { padding: 22px 26px; overflow-y: auto; }

.modal-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 26px 22px;
    border-top: 1px solid var(--border);
}

.modal-foot.between { justify-content: space-between; }

/* 轻提示：复制成功等场景默认不弹，这里给需要的地方用 */
.toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    animation: toast-in .26s cubic-bezier(.4, 0, .2, 1);
    pointer-events: auto;
}

.toast.success { border-color: #a7f3d0; background: var(--success-soft); color: #047857; }
.toast.error   { border-color: #fecaca; background: var(--danger-soft);  color: #b91c1c; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   登录页（后台）
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.auth-page::before,
.auth-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.auth-page::before {
    width: 560px; height: 560px;
    top: -220px; left: -160px;
    background: radial-gradient(circle, rgba(37, 244, 238, .42), transparent 68%);
}

.auth-page::after {
    width: 520px; height: 520px;
    bottom: -240px; right: -140px;
    background: radial-gradient(circle, rgba(254, 44, 85, .3), transparent 68%);
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px 36px 34px;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--gradient);
}

.auth-card .auth-logo {
    width: 54px; height: 54px;
    border-radius: 16px;
    background: var(--gradient);
    display: grid; place-items: center;
    color: #fff;
    margin-bottom: 20px;
    box-shadow: 0 10px 24px rgba(109, 140, 255, .34);
}

.auth-card h1 { font-size: 23px; letter-spacing: -.02em; margin-bottom: 7px; }
.auth-card .auth-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 28px; }

.auth-back {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.auth-back a { color: var(--primary); font-weight: 600; }

/* ==========================================================================
   杂项
   ========================================================================== */

.kv-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; }

.kv {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    background: var(--surface);
    font-size: 13.5px;
}

.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; color: var(--ink); text-align: right; word-break: break-all; }

.log-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 99px;
}

.log-level.info    { background: var(--info-soft);    color: #1d4ed8; }
.log-level.success { background: var(--success-soft); color: #047857; }
.log-level.warning { background: var(--warning-soft); color: #b45309; }
.log-level.error   { background: var(--danger-soft);  color: #b91c1c; }

.log-msg {
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--ink-soft);
}

.secret-key {
    font-family: var(--mono);
    font-size: 12.5px;
    background: var(--surface-soft);
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--ink-soft);
}

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* 响应式 */
@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .capability-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .hero-wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 44px 0 60px; }
    .hero-desc, .hero-features, .hero-stats { max-width: none; }
    .login-card { max-width: 480px; }

    .island { transform: translateX(calc(-100% - var(--shell-gap) - 10px)); }
    .island.show { transform: translateX(0); }
    .main { margin-left: 0; }
    .page-menu-btn { display: flex; }
}

@media (max-width: 820px) {
    .site-nav .inner { grid-template-columns: 1fr auto; padding: 0 18px; }
    .nav-links {
        position: absolute;
        top: var(--nav-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 18px 18px;
        background: #fff;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        display: none;
        justify-self: stretch;
    }
    .nav-links.show { display: flex; }
    .nav-toggle { display: flex; }
    .home-main, .page-shell { padding-left: 18px; padding-right: 18px; }
    .hero-features { grid-template-columns: minmax(0, 1fr); }
    .capability-grid { grid-template-columns: minmax(0, 1fr); }
    .stat-grid, .stat-grid.cols-3, .stat-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
    .grid-2, .grid-3, .contact-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .prose { padding: 26px 22px; }
    .search-box { width: 100%; }
    .toolbar-left { min-width: 0; }
    .topbar { flex-wrap: wrap; padding: 14px 18px; }
    .hero-stats { gap: 22px; flex-wrap: wrap; }
    .site-foot .inner { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   发布页
   ========================================================================== */

.publish-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

/* 分段控件：视频 / 图片 */
.seg {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 99px;
}

.seg-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 99px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all .18s ease;
}

.seg-item:hover { color: var(--ink-soft); }

.seg-item.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

/* 拖拽上传区 */
.dropzone {
    position: relative;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 26px 20px;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease;
}

.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }

.dropzone:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.dropzone.is-dragging {
    border-color: var(--primary);
    background: var(--primary-soft);
    border-style: solid;
}

.dropzone-inner { text-align: center; }

.dropzone-icon {
    width: 54px; height: 54px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: grid; place-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.dropzone-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.dropzone-hint { font-size: 12.5px; color: var(--muted-light); }

.dropzone-list { display: flex; flex-direction: column; gap: 8px; }

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.file-row-icon {
    display: flex;
    color: var(--primary);
    flex-shrink: 0;
}

.file-row-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row-size {
    font-size: 12px;
    color: var(--muted-light);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.file-row-remove {
    display: grid;
    place-items: center;
    width: 24px; height: 24px;
    flex-shrink: 0;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--muted-light);
    cursor: pointer;
    transition: all .15s ease;
}

.file-row-remove:hover { background: var(--danger-soft); color: var(--danger); }

/* 账户多选 */
.account-picker { display: flex; flex-direction: column; gap: 8px; }

.account-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all .15s ease;
}

.account-option:hover { border-color: var(--border-strong); background: var(--surface-soft); }

.account-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.account-option.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.account-option input[type="checkbox"] {
    width: 16px; height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: inherit;
}

.account-option-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.account-option-body .n {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-option-body .s { font-size: 12px; color: var(--muted); }

/* 发布进度 */
.result-list { display: flex; flex-direction: column; gap: 10px; }

.result-row {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.result-head { display: flex; align-items: center; gap: 10px; }

.result-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.result-reason {
    margin-top: 7px;
    font-size: 12.5px;
    color: var(--danger);
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .publish-grid { grid-template-columns: minmax(0, 1fr); }
}
