/* ============================================
   「光棱 · 白昼」 PRISM DAYBREAK SYSTEM
   Version: 2.0 | Style: Cyber-Pop Light
   ============================================ */

/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700;900&family=Oswald:wght@300;400;500;600;700&display=swap');

:root {
    /* 核心色板 */
    --c-bg: #F0F2F5;
    --c-bg-sub: #E4E7EB;
    --c-card: #FFFFFF;
    
    --c-primary: #FF3366;      /* 激昂红 - 视觉焦点 */
    --c-secondary: #00C2FF;    /* 未来蓝 - 科技元素 */
    --c-accent: #2D3436;       /* 墨黑 - 主要文字 */
    --c-text-sub: #636E72;     /* 灰 - 次要文字 */
    
    /* 装饰色 */
    --c-border: #D1D5DB;
    --c-grid: #E2E8F0;
    
    /* 状态色 */
    --s-success: #00B894;
    --s-warning: #FDCA40;
    --s-error: #FF3366;

    /* 尺寸与间距 */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --gap-xl: 40px;

    /* 动画 */
    --ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* 暗色模式变量 */
body.dark-mode {
    --c-bg: #0F172A;
    --c-bg-sub: #1E293B;
    --c-card: #1E293B;
    
    --c-primary: #FF3366;
    --c-secondary: #38BDF8;
    --c-accent: #F1F5F9;
    --c-text-sub: #94A3B8;
    
    --c-border: #334155;
    --c-grid: #334155;
}

/* 适配暗色模式的特定样式修正 */
body.dark-mode .bg-decoration { opacity: 0.1; }
body.dark-mode .bg-grid { opacity: 0.3; }
body.dark-mode .capsule-content { background: rgba(30, 41, 59, 0.9); }
body.dark-mode .workspace-container { background: rgba(15, 23, 42, 0.85); }
body.dark-mode .workspace-main { 
    background: 
        radial-gradient(circle at 50% 50%, #1e293b 0%, transparent 80%),
        repeating-linear-gradient(45deg, #0f172a 0, #0f172a 1px, transparent 1px, transparent 10px);
}
body.dark-mode .qr-scanner-frame { background: #fff; } /* 二维码区域保持白色 */
body.dark-mode .sys-btn { background: #1E293B; color: #94A3B8; }
body.dark-mode .sys-btn:hover { background: #334155; color: #fff; }

/* ============================================
   基础重置 & 全局排版
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Oswald', 'Noto Sans SC', sans-serif;
    background-color: var(--c-bg);
    color: var(--c-accent);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

/* 消除浏览器默认滚动条，使用自定义样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--c-text-sub);
    border-radius: 3px;
}

/* ============================================
   动态背景层 (The Grid)
   ============================================ */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(var(--c-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--c-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg);
    opacity: 0.6;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--c-primary);
    top: -100px;
    right: -100px;
    animation: float 10s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--c-secondary);
    bottom: -50px;
    left: -50px;
    animation: float 12s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}

.bg-decoration {
    position: absolute;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 10rem;
    color: var(--c-grid);
    opacity: 0.5;
    line-height: 1;
    z-index: -1;
    user-select: none;
}

.text-decoration-top {
    top: -40px;
    left: 20px;
}

.text-decoration-bottom {
    bottom: -20px;
    right: 20px;
    font-size: 6rem;
}

/* ============================================
   公告悬浮胶囊
   ============================================ */
.announcement-capsule {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    perspective: 1000px;
    display: flex; /* 确保自身容器也是 flex 方便对齐 */
    justify-content: center;
}

.announcement-capsule.hidden {
    display: none;
}

.announcement-capsule.announcement-visible {
    animation: capsuleDrop 0.5s ease-out;
}

.announcement-capsule.announcement-closing {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.capsule-content {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--c-border);
    padding: 6px 12px; /* 调整内边距 */
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    gap: 12px;
    transform-origin: top center;
    animation: capsuleDrop 0.6s var(--ease-out-quint);
    white-space: nowrap; /* 防止换行 */
}

/* ... existing animation ... */

.capsule-icon {
    width: 28px; /* 稍微调小图标容器 */
    height: 28px;
    background: var(--c-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ... */

/* 暗色模式特定修复 */
body.dark-mode .card-id {
    color: rgba(255, 255, 255, 0.1); /* 深色模式下显示为微白 */
}

/* ... */

.capsule-content {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--c-border);
    padding: 6px 16px 6px 6px;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    gap: 12px;
    transform-origin: top center;
    animation: capsuleDrop 0.6s var(--ease-out-quint);
}

.announcement-capsule[data-notice-type="success"] .capsule-content {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: #fff;
}

.announcement-capsule[data-notice-type="warning"] .capsule-content {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
}

.announcement-capsule[data-notice-type="error"] .capsule-content {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

@keyframes capsuleDrop {
    from { transform: translateY(-100px) rotateX(-45deg); opacity: 0; }
    to { transform: translateY(0) rotateX(0); opacity: 1; }
}

.capsule-icon {
    width: 32px;
    height: 32px;
    background: var(--c-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.capsule-icon svg { width: 16px; height: 16px; }

.capsule-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--c-accent);
    flex: 1;
    min-width: 0;
}

.capsule-text .byline {
    font-size: 0.72rem;
    color: var(--c-text-sub);
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.capsule-text .tag {
    font-weight: 700;
    color: var(--c-primary);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.capsule-text .msg {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.capsule-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-text-sub);
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
}

.capsule-close:hover {
    background: var(--c-bg-sub);
    color: var(--c-primary);
}

.capsule-close svg { width: 16px; height: 16px; }

/* ============================================
   主视口 & 场景切换
   ============================================ */
.main-viewport {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.scene-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.view-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.6s var(--ease-out-quint);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateY(20px);
}

.view-layer.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

/* 视图切换动画：离开 */
.view-layer.slide-out {
    opacity: 0;
    transform: scale(1.1) translateY(-20px);
}

/* ============================================
   场景1: Dashboard (项目选择)
   ============================================ */
.dashboard-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.dashboard-header h1 {
    font-size: 4rem;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-text-sub) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 2;
}

.header-sub {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1rem;
    letter-spacing: 4px;
    color: var(--c-text-sub);
    margin-top: 10px;
}

.header-decoration {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border: 1px dashed var(--c-primary);
    border-radius: 50%;
    opacity: 0.2;
    animation: rotate 20s linear infinite;
}

@keyframes rotate { to { transform: translateX(-50%) rotate(360deg); } }

.card-container {
    display: flex;
    gap: 20px;
    perspective: 1000px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
    padding: 0 20px;
}

/* 科技卡片 */
.tech-card {
    position: relative;
    width: 240px;
    height: 320px;
    background: var(--c-card);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-quint);
    /* 斜切角实现 */
    clip-path: polygon(
        10px 0, 100% 0, 
        100% calc(100% - 10px), calc(100% - 10px) 100%, 
        0 100%, 0 10px
    );
}

.tech-card:focus-visible {
    outline: 2px solid var(--c-primary);
    outline-offset: 4px;
}

/* 悬停效果 */
.tech-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.tech-card:hover .card-icon {
    transform: scale(1.1);
    color: var(--c-primary);
    border-color: var(--c-primary);
}

.tech-card:hover .card-action span {
    letter-spacing: 2px;
}

.tech-card:hover .card-action svg {
    transform: translateX(4px);
}

/* 卡片内部结构 */
.card-bg {
    position: absolute;
    inset: 0;
    background: var(--c-card);
    z-index: 0;
    border: 1px solid var(--c-border);
}

.tech-card:hover .card-bg {
    border-color: var(--c-primary);
}

.card-decoration-tl {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--c-primary);
    border-left: 2px solid var(--c-primary);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.card-decoration-br {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--c-secondary);
    border-right: 2px solid var(--c-secondary);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
}

.tech-card:hover .card-decoration-tl,
.tech-card:hover .card-decoration-br {
    opacity: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-icon {
    width: 48px;
    height: 48px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-sub);
    transition: all 0.3s;
}

.card-icon svg { width: 24px; height: 24px; }

.card-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-info p {
    font-family: 'Oswald', sans-serif;
    font-size: 0.8rem;
    color: var(--c-text-sub);
    letter-spacing: 1px;
}

.card-id {
    font-family: 'Oswald', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: var(--c-bg-sub);
    position: absolute;
    top: 40px;
    right: 20px;
    line-height: 1;
    pointer-events: none;
    opacity: 0.5;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--c-text-sub);
    border-top: 1px solid var(--c-border);
    padding-top: 16px;
}

.card-action svg { width: 16px; height: 16px; transition: transform 0.3s; }
.card-action span { transition: letter-spacing 0.3s; }


/* ============================================
   场景2: Workspace (扫码/登录)
   ============================================ */
.workspace-container {
    display: flex;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

/* 左侧栏 */
.workspace-sidebar {
    width: 280px;
    background: var(--c-bg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--c-border);
    position: relative;
}

.nav-back-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    color: var(--c-text-sub);
    margin-bottom: 60px;
    transition: all 0.3s;
}

.nav-back-btn svg { width: 20px; height: 20px; }
.nav-back-btn:hover { color: var(--c-accent); transform: translateX(-5px); }

.project-indicator h2 {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 10px;
}

.project-indicator p {
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    color: var(--c-text-sub);
    letter-spacing: 1px;
}

.project-mode-verification {
    color: var(--c-primary);
}

.project-mode-qr {
    color: var(--c-secondary);
}

.project-mode-neutral {
    color: var(--c-accent);
}

.decor-line {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 40px;
    height: 4px;
    background: var(--c-accent);
}

/* 主区域 */
.workspace-main {
    flex: 1;
    position: relative;
    background: 
        radial-gradient(circle at 50% 50%, #ffffff 0%, transparent 80%),
        repeating-linear-gradient(45deg, var(--c-bg-sub) 0, var(--c-bg-sub) 1px, transparent 1px, transparent 10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-box {
    width: 400px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.4s var(--ease-out-quint);
}

.panel-header {
    height: 48px;
    background: var(--c-bg);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.panel-header.success { background: var(--s-success); color: #fff; }
.panel-header.success .panel-title { color: #fff; }

.panel-title {
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--c-text-sub);
    letter-spacing: 1px;
}

.panel-dots {
    display: flex;
    gap: 4px;
}
.panel-dots::before, .panel-dots::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--c-border);
    border-radius: 50%;
}

.panel-body {
    padding: 30px;
}

/* 二维码扫描框 */
.qr-scanner-frame {
    width: 240px;
    height: 240px;
    margin: 0 auto 20px;
    position: relative;
    border: 1px solid var(--c-border);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px; /* 增加内边距 */
}

/* ... existing scanner-corner styles ... */
.scanner-corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--c-secondary);
    border-style: solid;
    border-width: 0;
    z-index: 2;
}

.tl { top: -1px; left: -1px; border-top-width: 3px; border-left-width: 3px; }
.tr { top: -1px; right: -1px; border-top-width: 3px; border-right-width: 3px; }
.bl { bottom: -1px; left: -1px; border-bottom-width: 3px; border-left-width: 3px; }
.br { bottom: -1px; right: -1px; border-bottom-width: 3px; border-right-width: 3px; }

.scanner-line {
    position: absolute;
    top: 0;
    left: 5%;
    width: 90%;
    height: 2px;
    background: var(--c-secondary);
    box-shadow: 0 0 10px var(--c-secondary);
    animation: scan 2s ease-in-out infinite;
    z-index: 10;
    opacity: 0.8;
    pointer-events: none;
}

@keyframes scan {
    0% { top: 10px; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 230px; opacity: 0; }
}

.qr-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* 防止溢出 */
}

.qr-content #qrCode {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.qr-content img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持比例 */
    margin: 0 auto;
}

.scan-status {
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 10px;
    color: var(--c-text-sub);
}

.workspace-feedback {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.workspace-feedback .scan-status {
    margin-top: 0;
}

.workspace-feedback .refresh-btn {
    max-width: 240px;
}

.scan-status.status-error {
    color: var(--s-error);
}

.scan-status.status-success {
    color: var(--s-success);
}

/* 按钮样式 */
.tech-btn {
    border: none;
    background: var(--c-accent);
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.tech-btn:hover { background: var(--c-primary); }
.tech-btn.outline { background: transparent; border: 1px solid var(--c-accent); color: var(--c-accent); }
.tech-btn.outline:hover { background: var(--c-accent); color: #fff; }
.tech-btn.text-only { background: transparent; color: var(--c-text-sub); border-bottom: 1px solid transparent; }
.tech-btn.text-only:hover { color: var(--c-primary); border-color: var(--c-primary); }

.tech-btn svg { width: 16px; height: 16px; }

/* 表单样式 */
.tech-form { width: 100%; }
.form-title { font-weight: 700; margin-bottom: 20px; text-align: center; }
.sf-inline-note {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-left: 3px solid rgba(2, 132, 199, 0.3);
    background: rgba(248, 250, 252, 0.82);
    color: var(--c-text-sub);
    font-size: 0.82rem;
    line-height: 1.65;
}
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-family: 'Oswald', sans-serif; font-size: 0.8rem; color: var(--c-text-sub); margin-bottom: 6px; }
.tech-input {
    width: 100%;
    padding: 10px;
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: 0;
    font-family: 'Oswald', sans-serif;
}
.tech-input:focus { outline: none; border-color: var(--c-primary); }
.input-row { display: flex; gap: 10px; }
.input-row .tech-input { flex: 1 1 auto; }
.input-row .tech-btn {
    width: 132px;
    flex: 0 0 132px;
}

.auth-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.auth-switch-btn {
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--c-text-sub);
    font-family: 'Oswald', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-switch-btn:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
    transform: translateY(-1px);
}

.auth-switch-btn.active {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: #fff;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.auth-switch-hint {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px dashed rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.38);
    color: var(--c-text-sub);
    font-size: 0.78rem;
    line-height: 1.55;
}

.qr-scanner-frame.auth-placeholder-active .scanner-corner,
.qr-scanner-frame.auth-placeholder-active .scanner-line {
    display: none;
}

.qr-scanner-frame.auth-placeholder-active {
    width: 100%;
    height: auto;
    min-height: 320px;
    padding: 18px;
    align-items: stretch;
    justify-content: flex-start;
}

.sf-auth-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    padding: 18px;
}

.sf-auth-choice-list {
    width: 100%;
    display: grid;
    gap: 12px;
}

.sf-auth-choice-card {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
    text-align: left;
    padding: 16px 18px;
    display: grid;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.sf-auth-choice-card:hover {
    transform: translateY(-2px);
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.1);
}

.sf-auth-choice-card:focus-visible {
    outline: 2px solid rgba(2, 132, 199, 0.38);
    outline-offset: 2px;
}

.sf-auth-choice-card-kicker {
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 1.6px;
    color: var(--c-text-sub);
}

.sf-auth-choice-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sf-auth-choice-card strong {
    font-family: 'Oswald', sans-serif;
    font-size: 1.02rem;
    color: var(--c-text-main);
    letter-spacing: 1px;
}

.sf-auth-choice-card-enter {
    flex: 0 0 auto;
    padding: 4px 10px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.82);
    color: var(--c-accent);
    font-family: 'Oswald', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 1px;
}

.sf-auth-choice-card span {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--c-text-sub);
}

.sf-auth-choice-card-qr {
    border-left: 4px solid rgba(2, 132, 199, 0.36);
}

.sf-auth-choice-card-sms {
    border-left: 4px solid rgba(15, 23, 42, 0.24);
}

.sf-auth-choice-card.active {
    border-color: rgba(2, 132, 199, 0.42);
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(255, 255, 255, 0.96));
    box-shadow: 0 18px 30px rgba(2, 132, 199, 0.12);
}

.sf-auth-choice-card.muted {
    opacity: 0.72;
}

.sf-auth-placeholder-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--c-border);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(2, 132, 199, 0.12));
    color: var(--c-accent);
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.sf-auth-placeholder-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    letter-spacing: 1.4px;
    color: var(--c-text-main);
}

.sf-auth-placeholder-desc {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--c-text-sub);
}

/* 结果面板 */
.result-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.result-panel.hidden { display: none; }

.result-summary {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    background: rgba(15, 23, 42, 0.04);
    color: var(--c-text-sub);
    font-size: 0.8rem;
    line-height: 1.6;
}

.result-data-container {
    background: var(--c-bg);
    border: 1px dashed var(--c-border);
    padding: 20px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
}

.result-actions { display: flex; gap: 10px; margin-bottom: 10px; }

/* 控制器 */
.system-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    z-index: 100; /* 提高层级，确保可点击 */
}

.sys-btn {
    width: 44px; /* 稍微加大 */
    height: 44px;
    background: #fff;
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--c-text-sub);
    border-radius: 4px; /* 方形圆角 */
}

.sys-btn:hover { background: var(--c-accent); color: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.sys-btn svg { width: 20px; height: 20px; }

/* 工具类 */
.hidden { display: none !important; }

/* ... existing styles ... */

/* 强制修正深色模式下的数字 ID */
body.dark-mode .card-id {
    color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .tech-card:hover .card-id {
    color: rgba(255, 255, 255, 0.2);
}

/* 修正公告栏在深色模式下的边框 */
body.dark-mode .capsule-content {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 修正深色模式下的按钮颜色 */
body.dark-mode .tech-btn {
    background: var(--c-accent); /* 浅色背景 */
    color: #0F172A; /* 深色文字 */
}

body.dark-mode .tech-btn:hover {
    background: var(--c-primary);
    color: #fff;
}

body.dark-mode .tech-btn.outline {
    background: transparent;
    border-color: var(--c-accent);
    color: var(--c-accent);
}

body.dark-mode .tech-btn.outline:hover {
    background: var(--c-accent);
    color: #0F172A;
}

body.dark-mode .tech-btn.text-only {
    background: transparent;
    color: var(--c-text-sub);
}

body.dark-mode .tech-btn.text-only:hover {
    color: var(--c-primary);
    border-color: var(--c-primary);
}

/* ============================================
   移动端适配 (Mobile Responsive)
   ============================================ */
@media screen and (max-width: 768px) {
    /* ===== 根本修复：允许页面滚动 ===== */
    body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .bg-layer {
        position: fixed;
        height: 100vh;
        height: 100dvh;
    }

    .main-viewport {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0 16px;
        padding-top: 60px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        align-items: flex-start;
        overflow: visible;
    }

    .scene-container {
        height: auto;
        min-height: auto;
        position: relative;
        padding-bottom: 20px;
    }

    /* ===== view-layer：display 切换代替动画 ===== */
    .view-layer {
        position: relative;
        height: auto;
        top: auto;
        left: auto;
        transform: none !important;
        opacity: 1 !important;
        display: none;
        pointer-events: all;
    }

    .view-layer.active {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* ===== Dashboard 项目选择页 ===== */
    .dashboard-header {
        margin-bottom: 24px;
        margin-top: 10px;
    }

    .dashboard-header h1 {
        font-size: 2.2rem;
    }

    .header-sub {
        font-size: 0.85rem;
        letter-spacing: 2px;
    }

    .header-decoration {
        width: 80px;
        height: 80px;
        top: -10px;
    }

    .card-container {
        padding: 0;
        gap: 12px;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* 卡片：两列紧凑布局 */
    .tech-card {
        width: calc(50% - 6px);
        max-width: 180px;
        height: 160px;
        clip-path: polygon(
            8px 0, 100% 0,
            100% calc(100% - 8px), calc(100% - 8px) 100%,
            0 100%, 0 8px
        );
    }

    .tech-card .card-content {
        padding: 14px;
    }

    .tech-card .card-icon {
        width: 36px;
        height: 36px;
        border-radius: 6px;
    }

    .tech-card .card-icon svg {
        width: 18px;
        height: 18px;
    }

    .tech-card .card-info h3 {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .tech-card .card-info p {
        font-size: 0.65rem;
    }

    .tech-card .card-id {
        font-size: 2.5rem;
        top: 20px;
        right: 10px;
    }

    .tech-card .card-action {
        padding-top: 10px;
        font-size: 0.75rem;
    }

    .tech-card .card-action svg {
        width: 12px;
        height: 12px;
    }

    /* 触摸反馈 */
    .tech-card:active {
        transform: scale(0.97);
        transition: transform 0.1s;
    }

    .tech-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* ===== Workspace 扫码/登录页 ===== */
    .workspace-container {
        flex-direction: column;
        width: 100%;
        height: auto;
        max-height: none;
        border-radius: 12px;
        overflow: visible;
    }

    .workspace-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 1px solid var(--c-border);
        position: sticky;
        top: 0;
        z-index: 20;
        background: var(--c-bg);
    }

    .nav-back-btn {
        margin-bottom: 0;
        font-size: 0.85rem;
        padding: 6px 10px;
        border-radius: 6px;
        background: var(--c-bg-sub);
    }

    .nav-back-btn span {
        display: inline;
        font-size: 0.8rem;
    }

    .nav-back-btn:active {
        transform: scale(0.95);
    }

    .project-indicator {
        text-align: right;
    }

    .project-indicator h2 {
        font-size: 1.1rem;
        margin-bottom: 0;
    }

    .project-indicator p {
        font-size: 0.7rem;
    }

    .decor-line {
        display: none;
    }

    .workspace-main {
        padding: 20px 16px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .panel-box {
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .result-panel {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
        display: none;
    }

    .result-panel:not(.hidden) {
        display: block;
    }

    .panel-header {
        background: transparent;
        border-bottom: none;
        padding: 0;
        margin-bottom: 12px;
        justify-content: center;
        height: auto;
    }

    .panel-header.success {
        background: var(--s-success);
        border-radius: 8px;
        padding: 10px 16px;
    }

    .panel-title {
        font-size: 0.9rem;
        text-align: center;
    }

    .panel-dots {
        display: none;
    }

    .panel-body {
        padding: 0;
    }

    .qr-scanner-frame {
        width: 200px;
        height: 200px;
        margin-bottom: 16px;
    }

    .tech-btn {
        padding: 14px;
        font-size: 0.95rem;
        border-radius: 6px;
        -webkit-tap-highlight-color: transparent;
    }

    .tech-btn:active {
        transform: scale(0.97);
        opacity: 0.9;
    }

    .refresh-btn {
        margin-top: 12px;
    }

    .tech-form {
        width: 100%;
    }

    .tech-input {
        padding: 14px 12px;
        font-size: 16px; /* >=16px 防止 iOS 自动缩放 */
        border-radius: 6px;
    }

    .input-group {
        margin-bottom: 16px;
    }

    .input-group label {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .input-row {
        flex-direction: column;
        gap: 10px;
    }

    .input-row .tech-btn {
        width: 100%;
        flex-basis: auto;
    }

    .auth-switcher {
        grid-template-columns: 1fr;
    }

    .qr-scanner-frame.auth-placeholder-active {
        min-height: 280px;
        padding: 14px;
    }

    .sf-auth-choice-list {
        gap: 8px;
    }

    .sf-auth-choice-card {
        padding: 14px;
    }

    .sf-inline-note {
        margin-bottom: 16px;
        padding: 10px 12px;
    }

    .sf-auth-choice-card-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .result-data-container {
        max-height: 150px;
        padding: 14px;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .result-actions {
        flex-direction: column;
        gap: 8px;
    }

    .system-controls {
        bottom: calc(10px + env(safe-area-inset-bottom));
        right: 10px;
        gap: 6px;
    }

    .sys-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        -webkit-tap-highlight-color: transparent;
    }

    .sys-btn:active {
        transform: scale(0.9);
    }

    .bg-shape {
        opacity: 0.15;
        animation: none;
    }

    .bg-grid {
        animation: none;
        opacity: 0.3;
    }

    .text-decoration-top, .text-decoration-bottom {
        font-size: 3rem;
        opacity: 0.08;
    }

    .announcement-capsule {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }

    .capsule-content {
        width: 100%;
        border-radius: 20px;
        padding: 6px 12px;
        gap: 8px;
    }

    .capsule-text {
        font-size: 0.75rem;
        min-width: 0;
        gap: 6px;
    }

    .capsule-text .byline {
        font-size: 0.66rem;
    }

    .capsule-text .msg {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 200px;
    }
}

/* ============================================
   复制提示 (Toast)
   ============================================ */
.copy-tooltip {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 0);
    background: var(--c-accent);
    color: #fff;
    padding: 10px 24px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    z-index: 2000;
    transition: all 0.3s var(--ease-out-quint);
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    letter-spacing: 1px;
}

.copy-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -10px);
}

.clipboard-helper {
    position: fixed;
    left: -9999px;
    top: -9999px;
    opacity: 0;
}

.token-row-spaced {
    margin-top: 10px;
}

/* ============================================
   顺丰微信绑定提示弹窗
   ============================================ */
.sf-bind-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out-quint);
}

.sf-bind-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.sf-bind-dialog {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s var(--ease-out-quint);
}

.sf-bind-overlay.show .sf-bind-dialog {
    transform: translateY(0) scale(1);
}

.sf-bind-header {
    height: 48px;
    background: var(--s-warning);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    color: #2D3436;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.sf-bind-header svg {
    width: 20px;
    height: 20px;
    stroke: #2D3436;
}

.sf-bind-body {
    padding: 24px 20px;
}

.sf-bind-title {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--c-accent);
}

.sf-bind-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sf-bind-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 0.85rem;
    color: var(--c-accent);
    line-height: 1.5;
}

.sf-bind-step .step-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: var(--c-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Oswald', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
}

.sf-bind-step strong {
    color: var(--c-primary);
}

.sf-bind-close {
    margin: 0 20px 20px;
    width: calc(100% - 40px);
}

/* 超小屏幕额外适配 */
@media screen and (max-width: 374px) {
    .tech-card {
        width: 100%;
        max-width: 100%;
        height: 140px;
    }

    .tech-card .card-content {
        padding: 12px;
    }

    .tech-card .card-info h3 {
        font-size: 0.9rem;
    }

    .dashboard-header h1 {
        font-size: 1.8rem;
    }

    .qr-scanner-frame {
        width: 180px;
        height: 180px;
    }

    .capsule-text .msg {
        max-width: 140px;
    }
}
