/* ============================================================
   明德AI · 演示系统底座  app.css  v1.0
   一套样式，靠 CSS 变量换肤。对齐深圳金融商会 AIOS 的质感。
   ============================================================ */
:root {
  --brand: #6E9C8A;
  --brand-d: #365B4F;
  --brand-l: #EAF3EF;
  --ink: #16202A;
  --ink-2: #5A6675;
  --ink-3: #8A95A3;
  --line: #E6EBF1;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --ok: #2E9E6B;
  --warn: #D98324;
  --bad: #C6443E;
  --info: #3B7DD8;
  --r: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 18px -12px rgba(16,24,40,.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D3DAE3; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 登录页 ---------------- */
.login {
  display: grid;
  grid-template-columns: 44% 56%;
  min-height: 100vh;
}
.login__brand {
  position: relative;
  padding: 56px 56px 40px;
  color: #fff;
  background:
    radial-gradient(1200px 600px at 12% 8%, color-mix(in srgb, var(--brand) 26%, transparent), transparent 60%),
    linear-gradient(150deg, var(--brand-d) 0%, #101A24 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.login__brand::after {
  content: "";
  position: absolute;
  right: -18%; bottom: -22%;
  width: 70%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 30%, transparent), transparent 68%);
};
.login__logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 600; letter-spacing: .02em;
}
.login__logo img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; }
.login__logo .mark {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-size: 17px; font-weight: 700;
}
.login__mid { margin-top: auto; margin-bottom: auto; position: relative; z-index: 1; }
.login__h {
  margin: 0 0 14px;
  font-size: 40px; line-height: 1.24; font-weight: 700; letter-spacing: -.01em;
}
.login__h em { font-style: normal; color: color-mix(in srgb, var(--brand) 55%, #F5D9A0); }
.login__sub { margin: 0 0 26px; font-size: 14px; color: rgba(255,255,255,.72); }
.login__pts { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.login__pts li { font-size: 13px; color: rgba(255,255,255,.8); padding-left: 16px; position: relative; }
.login__pts li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
}
.login__foot { font-size: 12px; color: rgba(255,255,255,.42); }

.login__form { display: grid; place-items: center; padding: 40px; background: #fff; }
.login__box { width: 100%; max-width: 384px; }
.login__title { margin: 0 0 6px; font-size: 26px; font-weight: 700; }
.login__hint { margin: 0 0 30px; font-size: 13px; color: var(--ink-3); }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; color: var(--ink-2); }
.field input {
  width: 100%; height: 44px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; color: var(--ink); background: #FCFDFE;
  transition: border-color .16s, box-shadow .16s;
}
.field input:focus {
  outline: none; border-color: var(--brand); background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  transition: filter .16s, transform .16s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn--full { width: 100%; }
.btn--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
.login__err { margin-top: 12px; font-size: 13px; color: var(--bad); min-height: 18px; }
.login__tip { margin-top: 26px; font-size: 12px; color: var(--ink-3); }
.login__meta { display: flex; justify-content: space-between; margin-top: 44px; font-size: 12px; color: var(--ink-3); }

/* ---------------- 系统框架 ---------------- */
.layout { display: flex; min-height: 100vh; }
.sider {
  flex: 0 0 224px; width: 224px;
  background: #0F1821; color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sider__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sider__brand img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: #fff; padding: 3px; }
.sider__brand .mark {
  width: 30px; height: 30px; border-radius: 6px; background: var(--brand);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.sider__name { font-size: 13px; font-weight: 600; line-height: 1.35; }
.sider__name span { display: block; font-size: 10.5px; font-weight: 400; color: rgba(255,255,255,.45); letter-spacing: .04em; }
.sider__nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.sider__grp { margin: 12px 8px 6px; font-size: 10.5px; letter-spacing: .1em; color: rgba(255,255,255,.3); }
.sider__a {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; margin-bottom: 2px;
  border-radius: 7px; font-size: 13px; color: rgba(255,255,255,.72);
  transition: background .14s, color .14s;
}
.sider__a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sider__a.is-on { background: var(--brand); color: #fff; font-weight: 500; }
.sider__a .ico { width: 16px; height: 16px; flex: 0 0 16px; opacity: .9; }
.sider__a .n {
  margin-left: auto; font-size: 11px; padding: 1px 6px; border-radius: 9px;
  background: rgba(255,255,255,.14); color: #fff;
}
.sider__a.is-on .n { background: rgba(0,0,0,.18); }
.sider__foot {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: 11px; color: rgba(255,255,255,.34);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; flex: 0 0 58px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 26px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar__t { font-size: 15px; font-weight: 600; }
.topbar__crumb { font-size: 12px; color: var(--ink-3); }
.topbar__sp { margin-left: auto; }
.topbar__u { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-l); color: var(--brand-d);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.topbar__u .nm { font-size: 13px; line-height: 1.3; }
.topbar__u .nm span { display: block; font-size: 11px; color: var(--ink-3); }

.content { padding: 24px 26px 48px; }
.page { display: none; }
.page.is-on { display: block; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------- 通用块 ---------------- */
.welcome {
  padding: 22px 24px; border-radius: var(--r); margin-bottom: 16px;
  background:
    radial-gradient(700px 220px at 8% 0%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%),
    linear-gradient(120deg, var(--brand-l) 0%, #fff 62%);
  border: 1px solid color-mix(in srgb, var(--brand) 18%, #fff);
}
.welcome .wt { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.welcome .ws { margin-top: 5px; font-size: 13px; color: var(--ink-2); }
.welcome .wc { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.welcome .wc span {
  font-size: 11.5px; padding: 3px 10px; border-radius: 20px;
  background: #fff; color: var(--brand-d); border: 1px solid color-mix(in srgb, var(--brand) 22%, #fff);
}

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  padding: 16px 18px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.kpi .k { font-size: 12px; color: var(--ink-3); }
.kpi .v { margin-top: 6px; font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.kpi .v small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.kpi .d { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.kpi .d.up { color: var(--ok); }
.kpi .d.down { color: var(--bad); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-head .more { margin-left: auto; font-size: 12px; color: var(--brand); cursor: pointer; }
.card-head .more:hover { text-decoration: underline; }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-23 { grid-template-columns: 2fr 1fr; }
.mb-14 { margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; font-size: 13px; }
thead th { font-size: 11.5px; font-weight: 500; color: var(--ink-3); border-bottom: 1px solid var(--line); letter-spacing: .02em; }
tbody td { border-bottom: 1px solid #F2F5F8; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FBFCFE; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; line-height: 1.6; white-space: nowrap;
}
.tag--ok { background: #E8F6EF; color: var(--ok); }
.tag--warn { background: #FDF2E4; color: var(--warn); }
.tag--bad { background: #FBEBEA; color: var(--bad); }
.tag--info { background: #EAF1FB; color: var(--info); }
.tag--mute { background: #F1F4F8; color: var(--ink-2); }

.bar { height: 6px; border-radius: 6px; background: #EEF2F6; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }

.todo { display: grid; gap: 10px; }
.todo__i {
  display: flex; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #FCFDFE;
}
.todo__i .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); margin-top: 8px; flex: 0 0 6px; }
.todo__i .tx { font-size: 13px; }
.todo__i .mt { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

.feed { display: grid; gap: 11px; }
.feed__i { display: flex; gap: 9px; font-size: 12.5px; color: var(--ink-2); }
.feed__i .t { color: var(--ink-3); font-size: 11.5px; flex: 0 0 46px; font-variant-numeric: tabular-nums; }
.feed__i b { color: var(--ink); font-weight: 500; }

.chart { width: 100%; height: 190px; }
.chart--sm { height: 150px; }

.donut { display: flex; align-items: center; gap: 20px; }
.legend { display: grid; gap: 7px; font-size: 12.5px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }

/* AI 助手 */
.chat { display: grid; gap: 12px; }
.chat__i { display: flex; gap: 10px; }
.chat__i.me { flex-direction: row-reverse; }
.chat__av {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--brand-l); color: var(--brand-d);
}
.chat__b {
  max-width: 76%; padding: 11px 14px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); font-size: 13.5px; line-height: 1.75;
}
.chat__i.me .chat__b { background: var(--brand); color: #fff; border-color: var(--brand); }
.chat__b .ev {
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line);
  font-size: 11.5px; color: var(--ink-3);
}
.chat__b .ev b { color: var(--brand-d); font-weight: 500; }
.chat__in { display: flex; gap: 9px; margin-top: 4px; }
.chat__in input {
  flex: 1; height: 40px; padding: 0 13px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13.5px;
}
.chat__in input:focus { outline: none; border-color: var(--brand); }

.empty { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }
.sec-title { margin: 22px 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.tip { font-size: 12px; color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; }

/* 响应式 */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-3, .g-23 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login__brand { display: none; }
  .layout { flex-direction: column; }
  .sider { position: static; width: 100%; height: auto; flex: none; }
  .sider__nav { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; }
  .sider__a { white-space: nowrap; margin: 0; }
  .sider__grp, .sider__foot { display: none; }
  .g-2 { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; }
}
