/* =====================================================
   AI 原型汇报平台 - 后台样式
   主题：明亮暖色调 + 光影动态 + 移动端优先
   ===================================================== */

:root {
    --bg:        #fff7ec;
    --bg-2:      #fff1da;
    --surface:   #ffffff;
    --surface-2: #fff8ee;
    --primary:   #ff8a3d;
    --primary-2: #ff6a1a;
    --primary-soft: #fff0e3;
    --accent:    #ffb454;
    --text:      #3d2a14;
    --text-2:    #7a6650;
    --muted:     #b3a18e;
    --border:    #f0e1c8;
    --success:   #2faa5c;
    --danger:    #e6502e;
    --info:      #3b8fd6;
    --shadow:    0 10px 30px rgba(255, 138, 61, .14);
    --shadow-sm: 0 4px 14px rgba(255, 138, 61, .12);
    --radius:    16px;
    --radius-sm: 10px;
    --gradient:  linear-gradient(135deg, #ffb454 0%, #ff6a1a 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ====== 应用骨架 ====== */
.app {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* ====== 侧边栏 ====== */
.sidebar {
    background: linear-gradient(180deg, #fff3df 0%, #ffe7c2 100%);
    border-right: 1px solid var(--border);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 30;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 14px;
}
.brand-logo {
    width: 44px; height: 44px;
    border-radius: 13px;
    background: var(--gradient);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    display: grid;
    place-items: center;
    box-shadow: 0 8px 20px rgba(255, 106, 26, .4);
    animation: glow 3s ease-in-out infinite;
}
.brand-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 1px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 11px;
    color: var(--text-2);
    text-decoration: none;
    font-weight: 600;
    transition: all .25s ease;
    position: relative;
}
.nav-item:hover {
    background: var(--primary-soft);
    color: var(--primary-2);
    transform: translateX(3px);
}
.nav-item.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.nav-ico {
    min-width: 24px; height: 22px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    font-size: 10px;
    font-weight: 800;
    border-radius: 6px;
    background: rgba(255, 255, 255, .5);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-item.active .nav-ico { background: rgba(255, 255, 255, .35); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 12px 10px; }
.ver { font-size: 11px; color: var(--muted); }

/* ====== 主区 ====== */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: 62px;
    display: flex; align-items: center; gap: 14px;
    padding: 0 22px;
    background: rgba(255, 247, 236, .9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar-title {
    font-size: 19px;
    font-weight: 800;
    flex: 1;
    color: var(--text);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.menu-btn {
    display: none;
    background: var(--primary-soft);
    border: none;
    color: var(--primary-2);
    font-size: 22px;
    width: 38px; height: 38px;
    border-radius: 10px;
    cursor: pointer;
}
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-badge {
    font-size: 13px; color: var(--text-2);
    background: var(--surface);
    padding: 6px 12px; border-radius: 20px;
    border: 1px solid var(--border);
    text-transform: capitalize;
}
.content { padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ====== 卡片/区块 ====== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}
.section-title {
    font-size: 16px; font-weight: 800; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.section-title::before {
    content: ''; width: 4px; height: 18px; border-radius: 4px;
    background: var(--gradient);
}
.page-head {
    display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap; margin-bottom: 20px;
}
.page-head h2 {
    font-size: 22px; font-weight: 800; flex: 1;
    background: var(--gradient);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ====== 按钮 ====== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s ease;
}
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-2); }
.btn-danger { background: #fee; color: var(--danger); border-color: #fcc; }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ====== 表单 ====== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 13px; font-weight: 700; color: var(--text-2); }
.field input, .field select, .field textarea,
input[type=text], input[type=password], input[type=number],
input[type=date], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    transition: all .2s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 138, 61, .18);
    background: #fff;
}
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ====== 表格 ====== */
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td {
    padding: 13px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
}
table.tbl th {
    background: var(--primary-soft);
    font-weight: 800;
    color: var(--primary-2);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    position: sticky; top: 0;
}
table.tbl tr { transition: background .2s; }
table.tbl tr:hover td { background: var(--surface-2); }
table.tbl tr:last-child td { border-bottom: none; }
.t-empty { text-align: center; color: var(--muted); padding: 36px; }

/* ====== 标签/徽章 ====== */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}
.tag-green { background: #e3f6ea; color: #1c8a44; }
.tag-orange { background: var(--primary-soft); color: var(--primary-2); }
.tag-gray { background: #f1ece4; color: var(--text-2); }
.tag-red { background: #fde; color: var(--danger); }
.tag-blue { background: #e7f1fd; color: var(--info); }

/* ====== 统计卡片 ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px; margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.stat-card::after {
    content: ''; position: absolute; right: -30px; top: -30px;
    width: 100px; height: 100px; border-radius: 50%;
    background: var(--gradient); opacity: .12;
}
.stat-label { font-size: 12.5px; color: var(--text-2); font-weight: 700; }
.stat-value {
    font-size: 30px; font-weight: 800; margin-top: 6px;
    background: var(--gradient);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ====== 工具栏 ====== */
.toolbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 16px;
}
.toolbar form { display: flex; gap: 10px; flex: 1; min-width: 200px; }
.toolbar .search {
    flex: 1; padding: 9px 13px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface);
}
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span {
    padding: 6px 11px; border-radius: 8px; font-size: 13px;
    border: 1px solid var(--border); background: var(--surface);
    text-decoration: none; color: var(--text-2);
}
.pager a:hover { background: var(--primary-soft); color: var(--primary-2); }
.pager .cur { background: var(--gradient); color: #fff; border-color: transparent; }

/* ====== 提示 ====== */
.alert {
    padding: 12px 16px; border-radius: 10px; margin-bottom: 16px;
    font-size: 13.5px; font-weight: 600;
    animation: fadeIn .4s ease;
}
.alert-success { background: #e3f6ea; color: #1c8a44; border: 1px solid #c5e8d1; }
.alert-error   { background: #fde; color: var(--danger); border: 1px solid #fcc; }
.alert-info    { background: #e7f1fd; color: var(--info); border: 1px solid #d0e5fb; }
.alert-warning { background: #fff3d6; color: #b07d00; border: 1px solid #ffe39a; }

/* ====== 二维码弹窗/展示 ====== */
.qr-box {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 20px;
}
.qr-box img { border-radius: 12px; box-shadow: var(--shadow); background:#fff; padding: 8px; max-width: 100%; }
.modal-mask {
    position: fixed; inset: 0; background: rgba(60, 30, 0, .45);
    display: none; align-items: center; justify-content: center;
    z-index: 100; padding: 20px;
}
.modal-mask.show { display: flex; animation: fadeIn .25s; }
.modal {
    background: var(--surface); border-radius: var(--radius);
    padding: 24px; max-width: 460px; width: 100%;
    box-shadow: var(--shadow); animation: pop .3s;
}
.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }

/* ====== 登录页 ====== */
.login-body {
    background: linear-gradient(135deg, #fff3df 0%, #ffe1b8 50%, #ffd28a 100%);
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
}
.login-scene { position: fixed; inset: 0; pointer-events: none; }
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: .55;
    animation: float 8s ease-in-out infinite;
}
.orb-1 { width: 320px; height: 320px; background: #ff8a3d; top: -80px; left: -60px; }
.orb-2 { width: 260px; height: 260px; background: #ffd56b; bottom: -60px; right: -40px; animation-delay: -2s; }
.orb-3 { width: 200px; height: 200px; background: #ff6a1a; top: 40%; right: 18%; opacity: .35; animation-delay: -4s; }
.login-card {
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 22px;
    padding: 40px 34px;
    width: min(380px, 92vw);
    box-shadow: 0 24px 60px rgba(255, 106, 26, .25);
    position: relative;
    z-index: 2;
    animation: pop .5s ease;
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
    width: 62px; height: 62px; margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--gradient);
    color: #fff; font-weight: 800; font-size: 24px;
    display: grid; place-items: center;
    box-shadow: 0 12px 30px rgba(255, 106, 26, .45);
    animation: glow 3s ease-in-out infinite;
}
.login-title {
    font-size: 26px; font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    letter-spacing: 2px;
}
.login-sub { font-size: 12px; color: var(--text-2); letter-spacing: 2px; margin-top: 4px; }
.login-form .field { margin-bottom: 18px; }
.login-form .btn { margin-top: 6px; height: 46px; font-size: 15px; }

/* ====== 动画 ====== */
@keyframes glow {
    0%,100% { box-shadow: 0 8px 20px rgba(255, 106, 26, .4); }
    50% { box-shadow: 0 8px 36px rgba(255, 106, 26, .75); }
}
@keyframes float {
    0%,100% { transform: translate(0,0) scale(1); }
    50% { transform: translate(20px, -30px) scale(1.08); }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .4s ease; }

/* 滚动展示：表格区可滚动 */
.scroll-list { max-height: 420px; overflow-y: auto; border-radius: 12px; }
.scroll-list::-webkit-scrollbar { width: 8px; }
.scroll-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 8px; }

/* ====== 图表（纯 CSS 柱状） ====== */
.chart {
    display: flex; align-items: flex-end; gap: 6px;
    height: 180px; padding: 10px 4px 0;
    overflow-x: auto;
}
.bar-col {
    flex: 1; min-width: 24px;
    display: flex; flex-direction: column; align-items: center;
    height: 100%;
}
.bar-stack {
    width: 60%; max-width: 28px; height: 100%;
    display: flex; align-items: flex-end; gap: 2px;
}
.bar {
    flex: 1; min-height: 2px; border-radius: 4px 4px 0 0;
    transition: height .5s ease;
    animation: growBar .6s ease;
}
.bar-pv { background: var(--gradient); }
.bar-uv { background: var(--accent); opacity: .85; }
.bar-label { font-size: 10px; color: var(--muted); margin-top: 6px; }
@keyframes growBar { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); } }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }

/* 进度条（版本占比） */
.progress {
    position: relative; width: 160px; height: 22px;
    background: var(--surface-2); border-radius: 11px;
    border: 1px solid var(--border); overflow: hidden;
}
.progress-bar {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: var(--gradient); border-radius: 11px;
    transition: width .6s ease;
}
.progress span {
    position: relative; z-index: 2;
    font-size: 11px; font-weight: 800;
    color: var(--text); padding-left: 8px; line-height: 22px;
}

/* ====== 响应式：移动端 ====== */
@media (max-width: 980px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        width: 240px; transform: translateX(-100%);
        transition: transform .3s ease; height: 100vh;
    }
    .sidebar.open { transform: none; box-shadow: var(--shadow); }
    .menu-btn { display: grid; place-items: center; }
    .content { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
    .topbar-title { font-size: 16px; }
    .user-badge { display: none; }
    table.tbl { display: block; }
    table.tbl thead { display: none; }
    table.tbl tr { display: block; padding: 10px; border-bottom: 1px solid var(--border); }
    table.tbl td { display: flex; justify-content: space-between; border: none; padding: 6px 4px; }
    table.tbl td::before { content: attr(data-l); color: var(--muted); font-weight: 700; font-size: 11px; }
}
@media (max-width: 520px) {
    .stat-value { font-size: 24px; }
    .page-head h2 { font-size: 18px; }
    .login-card { padding: 30px 22px; }
}
