/* ================= 页面背景 ================= */
body {
    background:
        linear-gradient(180deg, rgba(244, 245, 240, 0.38), rgba(244, 245, 240, 0.62)),
        url('../assets/home1.png') center/cover fixed no-repeat !important;
}

/* 避免 base.css 的旧伪元素背景与当前背景叠加 */
body::before,
body::after {
    display: none !important;
    background: none !important;
    background-image: none !important;
    animation: none !important;
}
/* ================= 认证/介绍页排版 ================= */
.fullscreen-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8vw; 
    flex-wrap: wrap; 
    padding: 20px;
    animation: smoothFadeIn 0.8s ease-out;
}

.title-container {
    max-width: 700px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 25%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0.7) 75%, rgba(255, 255, 255, 0) 100%);
    padding: 30px 40px; 
    border-radius: 20px; 
    text-align: center; 
}

.elegant-title {
    font-size: clamp(3rem, 5vw, 4.5rem); 
    color: var(--primary-moss);
    font-weight: 900;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.subtitle {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-muted);
    font-weight: 500;
}

.intro-content { max-width: 800px; padding: 40px; }
.tagline { font-size: 0.85rem; letter-spacing: 2px; color: var(--primary-moss); margin-bottom: 20px; }
.hero-title { font-size: 5rem; line-height: 1.1; font-weight: 400; color: var(--primary-moss); margin-bottom: 30px; }
.hero-desc { font-size: 1.2rem; color: var(--text-muted); max-width: 500px; margin-bottom: 40px; }

/* ================= 左右分栏与导航 (解决问题5) ================= */
.dashboard-layout { 
    display: flex; 
    min-height: 100vh;
    align-items: stretch; /* 让左右两列等高，解决蒙版不到底的问题 */
    animation: smoothFadeIn 0.6s ease-out; 
}

.organic-sidebar {
    width: 280px;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(114,140,105,0.2);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo { font-size: 1.5rem; color: var(--primary-moss); margin-bottom: 50px; text-align: center; }
.sidebar-sublogo { font-size: 1rem; color: var(--primary-moss); margin-bottom: 50px; text-align: center; }

.side-nav { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.nav-btn {
    background: transparent; border: none; padding: 15px 20px; border-radius: 12px;
    text-align: left; font-size: 1.05rem; color: var(--text-muted); cursor: pointer;
    transition: all 0.3s ease; 
}
.nav-btn:hover { background: rgba(255,255,255,0.8); color: var(--primary-moss); }
.nav-btn.active { background: #fff; color: var(--primary-moss); box-shadow: var(--shadow-soft); font-weight: bold; }
.content-area { flex: 1; padding: 40px 60px; overflow-y: auto; }

/* ================= Tab切换与居中 (解决问题1、6) ================= */
.tab-pane { 
    display: none !important; /* 极其关键：强制隐藏非活跃状态，解决绿色圆圈不消失的问题 */
    animation: smoothFadeIn 0.4s ease; 
    width: 100%;
}
.tab-pane.active { 
    display: block !important; 
}
.tab-pane.active.center-flex { 
    display: flex !important; /* 强制flex布局，让按钮和圆圈完美垂直居中 */
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 80vh; 
}

/* ================= 呼吸圆圈核心设计 (解决问题2) ================= */
.circle-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 50px auto;
    border-radius: 50%;
    /* 外围的白色细圈与光晕 */
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.5), 
                0 0 0 16px rgba(255, 255, 255, 0.2);
}

.upload-circle, .status-circle {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    /* 核心修复：内部深色，外部浅色的径向渐变 */
    background: radial-gradient(circle at center, #3e5a47 0%, #8ba894 100%) !important;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; cursor: pointer;
    transition: filter 0.3s ease, transform 0.2s ease;
}

.upload-circle.breathing { animation: breatheCircle 4s ease-in-out infinite; }
.upload-circle:hover { filter: brightness(1.1); }
.upload-circle:active { transform: scale(0.98); }
.circle-text { font-size: 1.8rem; letter-spacing: 4px; text-align: center; }
.circle-progress { font-size: 3rem; font-weight: bold; margin-top: 10px; }

/* 状态圆圈特殊处理，防止 JS 破坏样式 */
#statusCard[style*="display: block"] {
    display: flex !important; 
    background: radial-gradient(circle at center, #2e4735 0%, #728c7b 100%) !important; /* 检测中颜色略深 */
    animation: breatheCircle 2s ease-in-out infinite; 
}

/* ================= 有机卡片、表单与按钮 ================= */
.organic-card, .card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: var(--shadow-soft);
    padding: 24px;
}

.btn-organic {
    background: var(--primary-moss); color: #fff; border: none;
    padding: 14px 32px; border-radius: 99px; font-size: 1rem;
    cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(62, 90, 71, 0.3);
}
.btn-organic:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(62, 90, 71, 0.4); filter: brightness(1.1); }
.btn-organic.outline { background: transparent; color: var(--primary-moss); border: 2px solid var(--primary-moss); box-shadow: none; }

.role-selector { background: var(--bg-sand); padding: 6px; border-radius: 16px; display: flex; gap: 8px;}
.role-btn { flex: 1; background: transparent; color: var(--text-muted); border: none; padding: 12px; transition: all 0.25s ease; cursor: pointer;}
.role-btn.active { background: var(--primary-moss) !important; color: #fff !important; font-weight: bold; border-radius: 12px; box-shadow: 0 4px 12px rgba(62, 90, 71, 0.2); }
.form-group { width: 100%; margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 6px; font-weight: bold; color: var(--text-dark); }
.form-group input { width: 100%; padding: 11px 12px; border: 1px solid #c8ddcc; border-radius: 12px; background: #fbfefb; }

/* 认证表单动画栈 (保留必要逻辑) */
.auth-panel-stack { width: 100%; position: relative; transition: height .26s ease; }
.auth-panel { width: 100%; position: absolute; top: 0; left: 0; visibility: hidden; opacity: 0; transform: translateY(10px); pointer-events: none; }
.auth-panel.active { visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto; transition: opacity .28s ease, transform .28s ease; }

/* ================= 历史记录与结果卡片 ================= */
.result-card { background: rgba(255,255,255,0.8); border-left: 6px solid var(--ok); padding: 18px; border-radius: 14px; margin-top: 16px; }
.result-card.danger { border-left-color: var(--danger); }
.detection-history { margin-top: 20px; }
.history-item { background: rgba(255,255,255,0.6); padding: 14px; margin-bottom: 9px; border-radius: 12px; border-left: 4px solid var(--primary-moss); }
.history-item h4 { margin-bottom: 5px; color: var(--text-dark); }
.history-item p { color: var(--text-muted); margin: 2px 0; font-size: .9rem; }
.timestamp { color: #6e7f71; font-size: .8rem; }

/* 动态风险词云 */
#wordCloudList {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-cloud-field {
    position: relative;
    width: min(100%, 520px);
    height: 260px;
    overflow: hidden;
    border-radius: 20px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.72), rgba(255,255,255,0.22));
}

.word-cloud-field::before {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 18px;
    border: 1px dashed rgba(62, 90, 71, 0.18);
}

.word-cloud-item {
    position: absolute;
    left: var(--left);
    top: var(--top);
    z-index: 1;
    transform: translate(-50%, -50%) rotate(var(--rotate));
    animation: wordFloat var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

.word-cloud-label {
    display: inline-block;
    max-width: 150px;
    padding: 4px 7px;
    border-radius: 9px;
    color: var(--from);
    background: linear-gradient(90deg, var(--from), var(--to));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
    text-shadow: 0 8px 24px rgba(31, 43, 36, 0.12);
}

@keyframes wordFloat {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--rotate)) scale(1); }
    50% { transform: translate(calc(-50% + 6px), calc(-50% - 8px)) rotate(var(--rotate)) scale(1.04); }
}

/* 关键动画定义 */
@keyframes smoothFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breatheCircle { 0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(114,140,105,0.2); } 50% { transform: scale(1.08); box-shadow: 0 0 80px rgba(114,140,105,0.4); } }

/* 1. 隐藏原生的“选择文件”丑陋按钮 */
.file-input { 
    display: none !important; 
}

/* 2. 防止 JS 的 inline style (display: block) 破坏圆圈内的 Flex 居中布局 */
#uploadCard[style*="display: block"],
#statusCard[style*="display: block"] {
    display: flex !important; 
}

/* ================= 侧边栏底部与退出按钮 ================= */
.sidebar-bottom {
    /* 核心魔法：在 flex 布局中，mt-auto 会自动把上面的空间撑满，将自己挤到最底部 */
    margin-top: auto; 
    padding-top: 20px;
    border-top: 1px solid rgba(114, 140, 105, 0.2); /* 一条极淡的分割线 */
    text-align: center;
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

/* 悬浮状态：稍微加深颜色，作为一种温和的退出反馈 */
.btn-text:hover {
    color: var(--primary-moss); 
    background: rgba(62, 90, 71, 0.05); /* 极淡的绿色背景底托 */
    border-radius: 12px;
}

/* ================= 守护记录：横向指标卡片排版 ================= */
.history-metrics {
    display: flex;
    gap: 12px;
    margin: 10px 0;
    flex-wrap: wrap; /* 适配手机屏幕，宽度不够时会自动换行 */
}

.history-metric {
    flex: 1; 
    border-radius: 12px;
    padding: 12px 14px;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.history-metric .metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.history-metric .metric-value {
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.3;
}

/* ================= 交通灯动态颜色体系 ================= */
/* 中性底色 (用于当前评价) */
.neutral-bg { 
    background: rgba(255, 255, 255, 0.6); 
}

/* 绿色 (LOW 级别) */
.risk-low-bg { 
    background: #f2fbf4; 
    border-color: rgba(46, 125, 50, 0.15); 
}
.risk-low-text { color: #2e7d32; }

/* 黄色 (MEDIUM 级别) */
.risk-medium-bg { 
    background: #fff8e6; 
    border-color: rgba(180, 105, 18, 0.15); 
}
.risk-medium-text { color: #b46912; }

/* 红色 (HIGH 级别) */
.risk-high-bg { 
    background: #fdf2f2; 
    border-color: rgba(186, 26, 26, 0.15); 
}
.risk-high-text { color: #ba1a1a; }

/* ================= 左右分栏修复（暴力破解版） ================= */
.tab-content-split {
    display: flex;
    gap: 40px;
    align-items: flex-start !important; 
    /* 核心：确保轨道高度完全由左侧内容决定，不加任何限制 */
    height: auto !important; 
    min-height: 100vh;
    position: relative; /* 为绝对定位提供参照点 */
}

.main-column {
    /* 左侧留下 360px (瀑布流宽度320 + 间距40) 的空白空间，防止文字被盖住 */
    width: calc(100% - 360px); 
    max-width: 650px; 
}

/* ================= 瀑布流外层容器：固定定位 ================= */
.waterfall-column {
    width: 320px;
    height: calc(100vh - 120px) !important; 
    overflow: hidden;
    
    /* 核心大招：放弃软弱的 sticky，改用基于父容器的绝对位置计算！ */
    /* 我们利用 fixed 把瀑布流钉死在屏幕右侧 */
    position: fixed !important;
    top: 60px !important; 
    /* 动态计算右侧位置，根据你的实际内边距微调 */
    right: 40px !important; 
    z-index: 10;
    
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 5%, black 95%, transparent 100%);
}

/* （下面的 .waterfall-track 和 .qa-card 样式保持不变） */
.waterfall-track {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: waterfallScroll 400s linear infinite; 
}
.waterfall-track:hover {
    animation-play-state: paused;
}
@keyframes waterfallScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } 
}

/* 题目答案对卡片 */
.qa-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(62, 90, 71, 0.05);
    transition: transform 0.3s ease, background 0.3s ease;
}

.qa-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(-4px); /* 悬浮时向左微凸，增加互动感 */
}

/* 题目文字风格：深色、加粗，视觉重心 */
.qa-card .q-text {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.5;
}

/* 答案文字风格：标志性苔藓绿、略细，拉开层次 */
.qa-card .a-text {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--primary-moss);
    line-height: 1.4;
    padding-top: 10px;
    border-top: 1px dashed rgba(114, 140, 105, 0.2); /* 题目和答案之间加一条虚线分割 */
}

/* 瀑布流核心动画 (从下往上滚动符合阅读习惯) */
@keyframes waterfallScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); } /* 因为 JS 会复制一倍的 DOM，所以滚动 50% 就能完美无缝衔接 */
}
