/* =========================================================
   VisionTrend · 复刻样式表
   ========================================================= */
:root{
  --purple:#6c5ce7;
  --purple-d:#5a49d6;
  --purple-l:#8a7bf0;
  --teal:#14b8a6;
  --teal-d:#0e9e8f;
  --orange:#f5a623;
  --pink:#e8325f;
  --blue:#3d7ef0;
  --ink:#1c2028;
  --text:#2f3542;
  --muted:#5a6270;
  --muted-2:#8d95a3;
  --muted-3:#a9b0bc;
  --line:#eef0f5;
  --line-2:#e0e3ea;
  --bg:#f4f5f9;
  --card:#ffffff;
  --shadow:0 1px 2px rgba(16,24,40,.04), 0 10px 30px rgba(16,24,40,.05);
  --shadow-sm:0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.05);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  font-size:15px;
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
a{color:inherit;text-decoration:none}
button,input,select{font-family:inherit}

/* ---------------- top bar ---------------- */
.topbar{
  position:sticky;top:0;z-index:60;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  height:84px;
  display:flex;align-items:center;
  padding:0 34px;
}
.logo{
  font-size:27px;font-weight:800;letter-spacing:-.6px;
  display:inline-flex;align-items:baseline;
  flex:none;
}
.logo .v{color:var(--purple)}
.logo .t{color:#e0873a}
.nav{display:flex;align-items:center;gap:12px;margin-left:36px}
.nav a{
  display:inline-block;
  font-size:16px;color:#39404d;
  padding:10px 19px;border-radius:10px;
  transition:background .18s,color .18s,box-shadow .18s;
  white-space:nowrap;
}
.nav a:hover{background:#f4f2fe;color:var(--purple)}
.nav a.active{
  background:var(--purple);color:#fff;font-weight:500;
  box-shadow:0 8px 18px rgba(108,92,231,.28);
}

/* ---------------- layout ---------------- */
main{padding-bottom:70px}
.container{max-width:1248px;margin:0 auto;padding:0 24px}
.container.narrow{max-width:756px}

.page-hero{text-align:center;padding:58px 0 30px}
.page-hero h1{
  margin:0;font-size:34px;font-weight:800;letter-spacing:.6px;color:var(--ink);
}
.page-hero.teal h1{color:#0fa493}
.page-hero p{margin:16px 0 0;font-size:16px;color:#59616f}

/* ---------------- cards ---------------- */
.card{
  background:var(--card);
  border-radius:16px;
  box-shadow:var(--shadow);
}
.card-head{
  display:flex;align-items:center;justify-content:space-between;gap:20px;
  padding:22px 28px;
}
.card-head h2{
  margin:0;font-size:18px;font-weight:700;color:var(--ink);
  display:flex;align-items:center;gap:9px;
}
.card-head .hint{font-size:13px;color:var(--muted-2)}
.head-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}

/* ---------------- form controls ---------------- */
.filter-card{
  display:flex;flex-wrap:wrap;align-items:center;
  gap:22px 34px;
  padding:26px 32px;
  margin-bottom:26px;
}
.field{display:flex;align-items:center;gap:12px}
.field > label{font-size:15px;color:var(--text);white-space:nowrap}
.sep{color:var(--text)}

.select,.input{
  height:42px;
  border:1px solid var(--line-2);
  border-radius:8px;
  background:#fff;
  color:var(--text);
  font-size:15px;
  padding:0 14px;
  outline:none;
  transition:border-color .18s,box-shadow .18s;
  min-width:0;
}
.select{
  appearance:none;-webkit-appearance:none;
  padding-right:36px;
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a6adb9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 13px center;
  cursor:pointer;
}
.input::placeholder{color:#b6bdc9}
.select:focus,.input:focus{border-color:#b3a8f8;box-shadow:0 0 0 3px rgba(108,92,231,.13)}

.btn{
  height:42px;padding:0 25px;border:0;border-radius:8px;
  font-size:15px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  transition:background .18s,border-color .18s,color .18s,box-shadow .18s,transform .12s;
  white-space:nowrap;
}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--purple);color:#fff;box-shadow:0 5px 14px rgba(108,92,231,.28)}
.btn-primary:hover{background:var(--purple-d)}
.btn-outline{background:#fff;color:#39404d;border:1px solid var(--line-2);font-weight:500}
.btn-outline:hover{border-color:#c3c9d4;background:#fbfbfd}
.btn-teal{background:var(--teal);color:#fff;box-shadow:0 5px 14px rgba(20,184,166,.26)}
.btn-teal:hover{background:var(--teal-d)}
.btn-sm{height:34px;padding:0 15px;font-size:14px;font-weight:500;border-radius:8px}

/* switch */
.switch{display:inline-flex;align-items:center;gap:10px;cursor:pointer;user-select:none}
.switch input{position:absolute;opacity:0;pointer-events:none}
.switch .track{
  width:46px;height:26px;border-radius:999px;background:#d9dde5;
  position:relative;transition:background .2s;flex:none;
}
.switch .track i{
  position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(16,24,40,.25);transition:left .2s;
}
.switch input:checked + .track{background:var(--purple)}
.switch input:checked + .track i{left:23px}
.switch .lbl{font-size:15px;color:var(--text)}

/* stepper */
.stepper{display:flex;align-items:center}
.stepper button{
  width:42px;height:42px;border:1px solid var(--line-2);background:#fff;color:#5a6270;
  font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;
}
.stepper button:first-child{border-radius:8px 0 0 8px}
.stepper button:last-child{border-radius:0 8px 8px 0}
.stepper button:hover{background:#f7f7fb;color:var(--purple)}
.stepper .input{border-radius:0;border-left:0;border-right:0;width:88px;text-align:center}

/* ---------------- table ---------------- */
.table-wrap{padding:18px 26px 26px;overflow-x:auto}
table.vt{width:100%;border-collapse:separate;border-spacing:0;min-width:640px}
table.vt thead th{
  background:#f6f7fa;color:var(--text);font-size:14px;font-weight:600;
  text-align:left;padding:14px 18px;white-space:nowrap;
}
table.vt thead th:first-child{border-radius:8px 0 0 8px}
table.vt thead th:last-child{border-radius:0 8px 8px 0}
table.vt tbody td{
  padding:16px 18px;border-bottom:1px solid #f1f3f7;font-size:15px;vertical-align:middle;
}
table.vt tbody tr:last-child td{border-bottom:0}
table.vt tbody tr:hover td{background:#fbfbfe}

.sort{display:inline-flex;flex-direction:column;gap:3px;margin-left:7px;vertical-align:middle;cursor:pointer}
.sort i{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;display:block}
.sort i:first-child{border-bottom:5px solid #c6ccd6}
.sort i:last-child{border-top:5px solid #c6ccd6}
.sort.asc i:first-child{border-bottom-color:var(--purple)}
.sort.desc i:last-child{border-top-color:var(--purple)}

.rank{
  width:30px;height:30px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:14px;font-weight:700;color:#8b93a1;background:#eef0f4;
}
.rank.r1{background:linear-gradient(155deg,#f8cd57,#e9a01c);color:#fff}
.rank.r2{background:linear-gradient(155deg,#bcc3cd,#98a1ae);color:#fff}
.rank.r3{background:linear-gradient(155deg,#d08b3f,#b5651d);color:#fff}

.topic{font-weight:600;color:var(--ink)}
.topic .cn{color:#7c6cf5;font-weight:500}
.cell-num{color:var(--text)}
.gr{font-weight:600;white-space:nowrap}
.gr.down{color:#e8443a}
.gr.up{color:#1eab5c}
.gr span{font-size:12px}

/* spark bars */
.spark{display:flex;gap:12px}
.spark .col{display:flex;flex-direction:column;align-items:center;gap:6px}
.spark .bar{
  width:26px;height:46px;border-radius:5px;background:#eef0f4;
  display:flex;align-items:flex-end;justify-content:center;
}
.spark .bar i{display:block;width:26px;height:14px;border-radius:5px;background:linear-gradient(180deg,#7ea6f4,#5b8cee);opacity:.85}
.spark .yr{font-size:10px;color:#9aa2af;line-height:1}

/* ratio bar (年度榜单) */
.ratio{position:relative;height:10px;border-radius:5px;background:#eef0f4;overflow:hidden;min-width:120px}
.ratio i{display:block;height:10px;width:58%;border-radius:5px;background:linear-gradient(90deg,#a9b6f6,#c7cef8)}

/* fixed layout table (论文管理) */
table.vt.fixed{table-layout:fixed}
table.vt .paper-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
table.vt .doi{color:#3a4150;display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
table.vt .doi:hover{color:var(--purple);text-decoration:underline}

/* ---------------- tag pills ---------------- */
.tags{display:flex;flex-wrap:wrap;gap:6px;max-width:300px}
.tag{
  display:inline-block;font-size:12px;line-height:1.5;
  padding:2px 9px;border-radius:5px;
  background:#ece9fe;color:#6c5ce7;
}

/* ---------------- line chart ---------------- */
.chart-panel{
  margin:0 24px 24px;
  border:1px solid #f2f3f7;
  border-radius:12px;
  background:#fff;
  padding:8px 6px 18px;
}
.chart-panel svg{display:block;width:100%;height:auto}
.ax{font-size:13px;fill:#9aa2af}
.legend{
  display:flex;justify-content:center;align-items:center;gap:30px;flex-wrap:wrap;
  margin-top:6px;font-size:14px;color:#4b5361;
}
.legend .item{display:flex;align-items:center;gap:9px}
.legend .dot{width:13px;height:13px;border-radius:4px;flex:none}

/* ---------------- bar race ---------------- */
.year-badge{font-size:15px;color:var(--purple);font-weight:600;margin-right:6px}
.year-badge b{font-weight:700}
.race-body{padding:22px 40px 10px 16px}
.race-plot{position:relative}
.race-grid{position:absolute;top:0;bottom:34px;left:216px;right:100px;pointer-events:none}
.race-grid .gline{position:absolute;top:0;bottom:0;width:1px;background:#e9ecf2}
.race-canvas{position:relative;height:377px}
.race-row{position:absolute;left:0;right:0;height:26px;display:grid;grid-template-columns:200px 1fr 60px;align-items:center;transition:top .65s cubic-bezier(.4,.05,.2,1),opacity .35s}
.race-row.out{opacity:0}
.race-row .rlabel{overflow:hidden;display:flex;justify-content:flex-end;padding-right:10px}
.race-row .rlabel span{font-size:14px;color:#6a7180;white-space:nowrap;line-height:26px}
.race-row .rbar{position:relative;height:26px}
.race-row .bar-fill{
  position:absolute;left:0;top:6px;height:14px;border-radius:3px;
  transition:width .65s cubic-bezier(.4,.05,.2,1);
}
.race-row .rval{
  position:absolute;top:3px;font-size:14px;color:#6a7180;
  transition:left .65s cubic-bezier(.4,.05,.2,1);
}
.race-axis{position:relative;height:26px;margin:8px 100px 0 216px}
.race-axis span{position:absolute;top:0;font-size:13px;color:#9aa2af;transform:translateX(-50%)}
.year-tabs{display:flex;gap:16px;padding:0 34px 26px;margin-top:6px}
.year-tabs button{
  flex:1;height:48px;border:0;border-radius:10px;background:#f4f5f8;color:#39404d;
  font-size:15px;font-weight:500;cursor:pointer;transition:background .2s,color .2s,box-shadow .2s;
}
.year-tabs button:hover{background:#ebeaf8;color:var(--purple)}
.year-tabs button.active{
  background:var(--purple);color:#fff;font-weight:600;
  box-shadow:0 8px 18px rgba(108,92,231,.3);
}

/* ---------------- graph page ---------------- */
.graph-box{position:relative;padding:0 24px 24px}
.graph-stage{position:relative;border-radius:10px;overflow:hidden}
canvas#graph{display:block;width:100%;height:auto;aspect-ratio:690 / 760}
.graph-legend{
  position:absolute;right:20px;bottom:22px;
  width:152px;background:#fff;border-radius:8px;
  box-shadow:0 4px 18px rgba(16,24,40,.13), 0 0 0 1px rgba(16,24,40,.04);
  padding:12px 13px;font-size:12px;
}
.graph-legend .gl-title{font-weight:700;color:#2f3542;font-size:13px}
.graph-legend .gl-sub{color:#9aa2af;font-size:11px;margin-top:2px}
.graph-legend .gl-list{margin:9px 0 0;display:flex;flex-direction:column;gap:8px}
.graph-legend .gl-item{display:flex;align-items:center;gap:8px;color:#4b5361}
.graph-legend .gl-dot{width:11px;height:11px;border-radius:50%;flex:none}
.graph-legend .gl-note{
  margin-top:11px;padding-top:9px;border-top:1px solid #f0f1f5;
  color:#a9b0bc;font-size:10.5px;line-height:1.5;
}

/* ---------------- alert ---------------- */
.alert{
  display:flex;gap:11px;align-items:flex-start;
  background:#f5f6f9;border-radius:8px;padding:16px 18px;margin:20px 32px 26px;
}
.alert .ico{
  width:20px;height:20px;border-radius:50%;background:var(--purple);color:#fff;
  font-size:13px;font-style:italic;font-weight:700;flex:none;
  display:flex;align-items:center;justify-content:center;margin-top:2px;
  font-family:Georgia,serif;
}
.alert .alert-title{color:#6c5ce7;font-size:15px;font-weight:500}
.alert .alert-body{color:#5a6270;font-size:14px;line-height:1.7;margin-top:2px}

/* ---------------- tabs ---------------- */
.tabs{display:flex;gap:26px;padding:22px 32px 0;border-bottom:1px solid var(--line)}
.tabs button{
  background:none;border:0;padding:0 0 14px;cursor:pointer;
  font-size:16px;color:#6a7180;position:relative;
}
.tabs button.active{color:var(--purple);font-weight:600}
.tabs button.active::after{
  content:'';position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--purple);border-radius:2px;
}
.tab-panel{padding:26px 32px 30px}

/* ---------------- stat cards (about) ---------------- */
.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:24px}
.stat{
  position:relative;overflow:hidden;background:#fff;border-radius:12px;
  padding:24px 26px 20px;box-shadow:var(--shadow-sm);
}
.stat::before{content:'';position:absolute;top:0;left:0;right:0;height:4px;background:var(--c)}
.stat .num{font-size:34px;font-weight:800;color:var(--ink);letter-spacing:-.5px;line-height:1.2}
.stat .lbl{font-size:15px;color:var(--text);margin-top:8px}
.stat .unit{font-size:13px;color:#9aa2af;margin-top:3px}

.conf-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;margin-top:24px}
.conf{
  position:relative;overflow:hidden;background:#fff;border-radius:12px;
  padding:26px 26px 22px;box-shadow:var(--shadow-sm);
}
.conf .blob{position:absolute;border-radius:50%;pointer-events:none}
.conf .badge{
  display:inline-block;font-size:13px;font-weight:700;letter-spacing:.6px;
  padding:4px 12px;border-radius:6px;color:#fff;position:relative;
}
.conf h3{margin:20px 0 6px;font-size:16px;font-weight:700;line-height:1.5;color:var(--ink);position:relative;max-width:290px}
.conf .meta{font-size:13px;color:#9aa2af}
.conf p{margin:16px 0 0;font-size:14px;color:#4b5361;line-height:1.8;position:relative}
.conf .divider{border-top:1px dashed #e5e8ef;margin:20px 0 14px}
.conf .count{font-size:15px;color:var(--text)}
.conf .count b{font-size:19px;font-weight:800}

.section-card{margin-top:24px}
.chart-area{padding:6px 28px 26px}
.chart-area svg{display:block;width:100%;height:auto}

/* ---------------- misc ---------------- */
.empty-row{color:#8d95a3;font-size:14px;text-align:center;padding:34px 0}
.btn-ghost-sm{
  height:36px;padding:0 18px;border:1px solid var(--line-2);border-radius:8px;
  background:#fff;color:#4b5361;font-size:14px;cursor:pointer;
}
.btn-ghost-sm:hover{border-color:#c3c9d4}
.row-actions{display:flex;align-items:center;gap:14px}
.link-danger{color:#e8443a;font-size:14px;cursor:pointer}
.link-danger:hover{text-decoration:underline}
.checkbox{width:18px;height:18px;border:1.5px solid #cfd4dd;border-radius:4px;display:inline-block;background:#fff;cursor:pointer}
.checkbox.on{background:var(--purple);border-color:var(--purple);position:relative}
.checkbox.on::after{content:'';position:absolute;left:5px;top:2px;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg)}

.toast{
  position:fixed;left:50%;bottom:44px;transform:translate(-50%,20px);
  background:rgba(28,32,40,.92);color:#fff;font-size:14px;
  padding:11px 22px;border-radius:10px;opacity:0;pointer-events:none;
  transition:opacity .25s,transform .25s;z-index:200;
}
.toast.show{opacity:1;transform:translate(-50%,0)}

@media (max-width:1100px){
  .stat-grid{grid-template-columns:repeat(2,1fr)}
  .conf-grid{grid-template-columns:1fr}
}
@media (max-width:900px){
  .topbar-inner{height:auto;flex-direction:column;align-items:flex-start;gap:10px;padding:14px 18px}
  .nav{margin-left:0;flex-wrap:wrap;gap:6px}
  .nav a{font-size:14px;padding:8px 13px}
  .race-row{grid-template-columns:130px 1fr 56px}
  .race-grid{left:146px}
  .race-axis{margin-left:146px}
}
