/* 脑电科研云端训练平台 · 响应式样式（2026-11-19 改版） */

:root{
  --bg:#eef3f9;
  --panel:#ffffff;
  --navy:#0e2b49;
  --teal:#12988b;
  --teal2:#22b8aa;
  --blue:#2478aa;
  --orange:#d8792f;
  --muted:#6b8097;
  --line:#dbe6f1;
  --line-soft:#e8f0f7;
  --text:#22364a;
  --danger:#c64f4f;
  --good:#258d68;
  --radius:16px;
  --shadow:0 12px 32px rgba(20,50,80,.08);
  --shadow-sm:0 4px 14px rgba(20,50,80,.07);
  --font:system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei UI","Microsoft YaHei",sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  min-height:100vh;
  overflow-x:hidden;
  background:
    radial-gradient(900px 500px at 5% -8%,#dcecf9 0,rgba(220,236,249,0) 62%),
    radial-gradient(700px 420px at 100% 0,#e2f6f4 0,rgba(226,246,244,0) 60%),
    linear-gradient(180deg,#f3f8fc 0,#eef3f9 100%);
  -webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto}
h1,h2,h3,p{margin:0;text-wrap:balance}
a{color:var(--blue)}
.hint,p{text-wrap:pretty}
button,input,select,textarea{font:inherit;color:inherit}

.shell{max-width:1200px;margin:0 auto;padding:clamp(14px,2vw,28px)}

/* ---------- 顶部 ---------- */
.top{
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  padding:clamp(16px,2.2vw,26px) clamp(16px,2.4vw,30px);
  border-radius:20px;
  color:#fff;
  background:linear-gradient(118deg,#0a2743 0,#125273 58%,#0d7e78 100%);
  box-shadow:0 18px 44px rgba(10,40,70,.18);
}
.top::after{
  content:"";
  position:absolute;
  right:-80px;bottom:-140px;
  width:340px;height:340px;
  background:radial-gradient(circle,rgba(95,240,210,.25),rgba(95,240,210,0) 65%);
  pointer-events:none;
}
.brand{display:flex;align-items:center;justify-content:center;gap:14px;min-width:0;position:relative;z-index:1}
.mark{
  flex:0 0 auto;
  width:54px;height:54px;
  border-radius:16px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:1px;
  background:linear-gradient(135deg,#3fdccd,#7fb0ff);
  color:#08283f;
  font-weight:900;
  font-size:13px;
  letter-spacing:.08em;
  line-height:1.05;
}
.brand-text{min-width:0;text-align:center}
.brand h1{font-size:clamp(18px,2.1vw,24px);font-weight:800;letter-spacing:.02em;line-height:1.25}

/* ---------- 通用卡片 ---------- */
.card{background:var(--panel);border:1px solid var(--line-soft);border-radius:var(--radius);box-shadow:var(--shadow)}
.section{padding:clamp(18px,2.2vw,24px)}
.section h2{font-size:17px;color:var(--navy);letter-spacing:.01em;line-height:1.35}
.section h3{font-size:15px;color:var(--navy);margin-bottom:10px}
.hint{color:var(--muted);font-size:12px;line-height:1.65}
.divider{height:1px;background:var(--line-soft);margin:16px 0}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.hidden{display:none!important}

/* ---------- 登录 / 注册 ---------- */
.auth-wrap{max-width:520px;margin:clamp(18px,3vw,36px) auto 0;overflow:hidden}
.auth{padding:clamp(20px,3vw,30px)}
.auth h2{font-size:clamp(20px,2.4vw,24px);color:var(--navy);margin-bottom:6px}
.auth .sub{color:var(--muted);font-size:12.5px;margin-bottom:20px;line-height:1.6}
.tabs{display:flex;gap:4px;padding:4px;margin-bottom:22px;border-radius:12px;background:#eef3f8}
.tabs button{
  flex:1;
  border:0;border-radius:9px;
  padding:11px 12px;
  background:transparent;
  color:var(--muted);
  font-weight:700;font-size:14px;
  cursor:pointer;
  transition:background .18s,color .18s,box-shadow .18s;
}
.tabs button.active{background:#fff;color:var(--navy);box-shadow:var(--shadow-sm)}
.tabs button:focus-visible{outline:2px solid var(--teal);outline-offset:2px}

/* ---------- 表单 ---------- */
.form{display:grid;gap:14px}
.field{display:grid;gap:7px}
.field label{font-size:12.5px;font-weight:700;color:#4a6279}
.field input,.field select,.field textarea,.input{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#f8fbfe;
  font-size:15px;
  outline:none;
  transition:border-color .15s,box-shadow .15s,background .15s;
}
.field input:focus,.field select:focus,.field textarea:focus,.input:focus{
  border-color:var(--teal);
  background:#fff;
  box-shadow:0 0 0 4px rgba(18,152,139,.12);
}
.consent{display:flex;gap:9px;align-items:flex-start;font-size:12.5px;line-height:1.65;color:#50677d}
.consent input{margin-top:3px;flex:0 0 auto;width:16px;height:16px;accent-color:var(--teal)}
.consent a{color:var(--blue);text-decoration:underline;text-underline-offset:2px}

/* ---------- 按钮 ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;
  padding:11px 18px;
  border:0;border-radius:11px;
  background:#eaf0f6;
  color:#29445c;
  font-weight:700;font-size:14px;
  text-decoration:none;
  cursor:pointer;
  user-select:none;
  transition:transform .12s,box-shadow .18s,filter .18s,background .18s;
}
.btn:hover{filter:brightness(1.03)}
.btn:active{transform:translateY(1px)}
.btn:focus-visible{outline:2px solid var(--navy);outline-offset:2px}
.btn:disabled{opacity:.55;cursor:not-allowed;filter:none;transform:none}
.btn.primary{background:linear-gradient(120deg,#109386,#1fb3a4);color:#fff;box-shadow:0 8px 20px rgba(18,152,139,.25)}
.btn.blue{background:linear-gradient(120deg,#2276a6,#2f8cc4);color:#fff;box-shadow:0 8px 20px rgba(36,120,170,.22)}
.btn.ghost{background:#fff;border:1px solid var(--line);color:#33506a}
.btn.ghost-danger{background:#fff;border:1px solid #f0c4c4;color:var(--danger)}
.btn.small{min-height:34px;padding:6px 12px;font-size:12.5px;border-radius:9px}
.btn.block{width:100%}

/* ---------- 仪表盘 ---------- */
.dashboard{margin-top:clamp(16px,2.2vw,22px);display:grid;gap:clamp(14px,1.8vw,20px)}
.dash-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.welcome h2{font-size:clamp(18px,2.2vw,22px);color:var(--navy);font-weight:800;line-height:1.35}
.welcome .hint{margin-top:3px}
.grid-main{display:grid;grid-template-columns:1.15fr .85fr;gap:clamp(14px,1.8vw,20px);align-items:start}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px;flex-wrap:wrap}
.section-title{display:flex;gap:11px;align-items:flex-start;min-width:0}
.step{
  flex:0 0 auto;
  width:28px;height:28px;
  display:grid;place-items:center;
  border-radius:9px;
  background:linear-gradient(135deg,#e7f6f3,#dff0fb);
  border:1px solid #cfebe6;
  color:#0f7d78;
  font-weight:900;font-size:13px;
}
.section-title>div{min-width:0}
.section-title .hint{margin-top:4px}
.head-actions{display:flex;gap:8px;flex-wrap:wrap;flex:0 0 auto}
code{
  font-family:ui-monospace,Consolas,"Courier New",monospace;
  font-size:.9em;
  padding:1px 5px;
  border-radius:5px;
  background:#eef4fa;
  border:1px solid #e0ebf5;
  color:#2d5470;
  overflow-wrap:anywhere;
}

/* 上传区 */
.drop{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:clamp(18px,3vw,26px);
  border:2px dashed #b7cfe2;
  border-radius:14px;
  background:linear-gradient(180deg,#f8fcff,#f1f9ff);
  text-align:center;
  cursor:pointer;
  transition:border-color .18s,background .18s;
}
.drop:hover{border-color:var(--teal);background:#f2fbfa}
.drop b{order:1;display:block;color:var(--navy);font-size:14.5px;margin-bottom:6px}
.drop .drop-hint{order:2;display:block;font-size:12px;color:var(--muted);line-height:1.6}
.drop input[type=file]{order:3;display:block;max-width:100%;margin:14px auto 0;font-size:12px;color:#3b566e}

.inline-form{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap}
.inline-form .input{flex:1;min-width:200px}

/* 状态文字 */
.status{font-size:12.5px;color:var(--muted);margin-top:10px;line-height:1.6}
.status:empty{margin-top:0}
.status.error,.error{color:var(--danger)}
.status.ok,.ok{color:var(--good)}

/* 提示块 */
.warnbox{
  padding:12px 14px;
  border-radius:12px;
  background:#fff7ea;
  border:1px solid #f0d4ae;
  color:#8a5a24;
  font-size:12px;
  line-height:1.7;
}
.infobox{
  padding:12px 14px;
  border-radius:12px;
  background:#eef7ff;
  border:1px solid #cfe3f2;
  color:#2a668a;
  font-size:12px;
  line-height:1.7;
}

/* 空状态 */
.empty{
  padding:26px 16px;
  text-align:center;
  color:#8ea2b6;
  font-size:12.5px;
  background:#fafcfe;
  border:1px dashed #dbe8f3;
  border-radius:12px;
}

/* ---------- 表格 ---------- */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:13px}
th{
  padding:10px 10px;
  text-align:left;
  white-space:nowrap;
  font-size:12px;
  font-weight:700;
  color:#6d8298;
  border-bottom:1px solid var(--line);
}
td{padding:12px 10px;text-align:left;vertical-align:top;color:#2d475e;border-bottom:1px solid var(--line-soft)}
tbody tr:last-child td{border-bottom:0}
td b{color:var(--navy)}

/* 状态徽标 */
.badge{
  display:inline-flex;align-items:center;gap:5px;
  padding:4px 9px;
  border-radius:999px;
  font-size:11px;font-weight:700;
  line-height:1.4;
}
.badge::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.75}
.badge.queued{background:#fff4e8;color:#b26a1f}
.badge.running{background:#e8f2ff;color:#286ea1}
.badge.done{background:#e8f8f0;color:#18835f}
.badge.failed{background:#fff0f0;color:#bb4545}
.metric{font-weight:800;color:var(--teal)}

/* 进度条 */
.progress{height:6px;border-radius:999px;background:#e9f0f6;overflow:hidden;margin-top:7px}
.progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#21b3a5,#4a9fd4);transition:width .4s}

.actions{display:inline-flex;gap:6px;flex-wrap:wrap}
.footer{text-align:center;color:#93a6b8;font-size:11.5px;line-height:1.7;padding:26px 10px 8px}

/* ---------- 说明页 ---------- */
.legal{max-width:850px;margin:clamp(14px,3vw,30px) auto;padding:clamp(18px,3vw,30px)}
.legal h1{font-size:clamp(22px,3.4vw,30px);color:var(--navy);margin-bottom:14px}
.legal .legal-body{font-size:14px;line-height:1.95;color:#314b63}
.legal ul{padding-left:20px;margin:10px 0 18px;font-size:13.5px;line-height:1.9;color:#435d74}
.legal li{margin-bottom:6px}

/* ---------- 平板 ---------- */
@media (min-width:761px){
  .section-title{flex:1 1 0;min-width:0}
  .section-head>.btn,.section-head>.head-actions{flex:0 0 auto}
}
@media (max-width:1024px){
  .grid-main{grid-template-columns:1fr}
}

/* ---------- 手机 ---------- */
@media (max-width:760px){
  .shell{padding:12px}
  .top{flex-direction:column;align-items:center;gap:10px;border-radius:16px;padding:18px 16px}
  .mark{width:46px;height:46px;border-radius:13px;font-size:11px}
  .brand{flex-direction:column;justify-content:center;gap:9px}
  .brand h1{font-size:18px;text-align:center}
  .auth-wrap{margin-top:14px;border-radius:14px}
  .auth{padding:18px}
  .tabs{margin-bottom:18px}
  .form{gap:13px}
  .field input,.field select,.field textarea,.input{font-size:16px;padding:12px 13px}
  .btn{min-height:46px}
  .btn.small{min-height:36px}
  .dash-head{align-items:flex-start}
  .dash-head .btn{width:auto;min-height:40px;margin-left:auto;padding:8px 16px}
  .section{padding:16px}
  .section-head{gap:10px}
  .section-head .btn.small{margin-left:auto}
  .head-actions{margin-left:auto}
  .drop{padding:18px 14px}
  .drop input[type=file]{font-size:12px}
  .inline-form{flex-direction:column}
  .inline-form .input{min-width:0}
  .inline-form .btn{width:100%}

  /* 表格 -> 卡片 */
  .table-wrap{overflow:visible}
  .table-wrap table,.table-wrap thead,.table-wrap tbody,.table-wrap tr,.table-wrap td{display:block;width:100%}
  .table-wrap thead{display:none}
  .table-wrap tr{
    margin-bottom:10px;
    padding:8px 12px;
    border:1px solid var(--line-soft);
    border-radius:12px;
    background:#fbfdff;
  }
  .table-wrap tr:last-child{margin-bottom:0}
  .table-wrap td{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:14px;
    padding:8px 0;
    border-bottom:1px dashed #e9f0f7;
    text-align:right;
    font-size:13px;
  }
  .table-wrap td:last-child{border-bottom:0}
  .table-wrap td::before{
    content:attr(data-label);
    flex:0 0 70px;
    text-align:left;
    font-size:12px;
    font-weight:700;
    color:#7b8fa4;
    line-height:1.75;
  }
  .table-wrap td>.cell{
    flex:1;
    min-width:0;
    text-align:right;
    overflow-wrap:anywhere;
  }
  .table-wrap td>.cell .actions{justify-content:flex-end}
  .table-wrap td>span.hint{display:inline}
  .table-wrap .progress{margin-left:auto;max-width:140px}
  .footer{padding:22px 6px 8px}
}

/* ---------- 小屏 ---------- */
@media (max-width:420px){
  .brand h1{font-size:17px}
  .auth h2{font-size:20px}
  .tabs button{font-size:13px;padding:10px}
}

@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important}
}
