:root {
  --primary: #f26b1d;
  --primary-soft: #fff4ec;
  --primary-dark: #d85a12;
  --header: #e8620c;
  --header-active: rgba(0, 0, 0, 0.16);
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #1f2329;
  --sub: #646a73;
  --muted: #8f959e;
  --line: #eceff3;
  --danger: #e34d59;
  --ok: #2ba471;
  --warn: #ed7b2f;
  --blue: #3d7eff;
  --shadow: 0 6px 24px rgba(31, 35, 41, 0.08);
  --font: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 13px; }
button, input, select, textarea { font-family: inherit; font-size: 13px; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
.hide { display: none !important; }

/* login */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% 110%, rgba(242, 107, 29, 0.16), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(255, 176, 110, 0.28), transparent 55%),
    linear-gradient(90deg, #fff 0%, #fff8f3 100%);
  display: flex; flex-direction: column;
}
.login-logo { position: absolute; top: 22px; left: 28px; display: flex; align-items: center; gap: 8px; color: var(--primary-dark); font-weight: 700; letter-spacing: 1px; }
.login-logo b { font-size: 20px; }
.login-logo span { font-weight: 500; letter-spacing: 3px; font-size: 12px; color: #c45512; }
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 72px 24px 40px; }
.login-card { width: 880px; max-width: 100%; min-height: 460px; background: #fff; border-radius: 8px; box-shadow: 0 12px 40px rgba(232, 98, 12, 0.12); display: flex; overflow: hidden; }
.login-banner {
  width: 46%; color: #fff; padding: 54px 36px; position: relative;
  background: linear-gradient(160deg, #ff9a45 0%, #f26b1d 42%, #e2550c 100%);
  overflow: hidden;
}
.login-banner .bubble { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.quote-mark { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 26px; }
.login-banner h2 { font-size: 26px; font-weight: 700; margin: 54px 0 18px; letter-spacing: 1px; }
.login-banner p { margin: 0; line-height: 1.8; font-size: 13px; opacity: .95; border-top: 1px solid rgba(255,255,255,.35); padding-top: 16px; }
.login-form { flex: 1; padding: 42px 46px 28px; }
.login-tabs { display: flex; gap: 28px; margin-bottom: 26px; color: #8a9099; }
.login-tabs .on { color: var(--primary); font-weight: 700; font-size: 18px; }
.login-tabs .off { font-size: 14px; padding-top: 4px; cursor: pointer; }
.field { display: flex; align-items: center; border: 1px solid #e5e6eb; border-radius: 4px; height: 42px; padding: 0 12px; margin-bottom: 16px; }
.field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(242,107,29,.12); }
.field input { border: 0; outline: 0; flex: 1; height: 38px; }
.field .ico { width: 18px; color: #b0b6bf; margin-right: 8px; }
.eye { border: 0; background: transparent; color: #98a0aa; }
.row-between { display: flex; justify-content: space-between; align-items: center; color: var(--sub); margin: 4px 0 14px; }
.row-between label { display: flex; gap: 6px; align-items: center; }
.link { color: var(--primary); background: none; border: 0; padding: 0; }
.checkline { display: flex; gap: 6px; align-items: flex-start; color: var(--sub); margin-bottom: 18px; line-height: 1.5; }
.btn-primary { background: var(--primary); color: #fff; border: 0; border-radius: 4px; height: 32px; padding: 0 12px; }
.btn-block { height: 40px; }
.btn-primary:hover { background: var(--primary-hover, #ff812e); }
.btn-block { width: 100%; font-size: 15px; letter-spacing: 4px; }
.btn-default { background: #fff; border: 1px solid #d9dde3; color: var(--text); border-radius: 4px; height: 32px; padding: 0 14px; }
.btn-default:hover { color: var(--primary); border-color: var(--primary); }
.btn-text { background: transparent; border: 0; color: var(--primary); padding: 0 6px; height: 28px; }
.btn-danger { background: #fff; border: 1px solid #f3b7bd; color: var(--danger); border-radius: 4px; height: 32px; padding: 0 12px; }
.login-foot { text-align: center; color: #8b919a; margin-top: 22px; }
.demo-tip { margin-top: 14px; background: var(--primary-soft); color: #9a4b12; border-radius: 4px; padding: 8px 10px; line-height: 1.6; }
.page-footer { text-align: center; color: #a0a6af; font-size: 12px; padding: 8px 12px 18px; }
.err { color: var(--danger); min-height: 18px; margin-top: -8px; margin-bottom: 8px; }

/* shell */
.shell { height: 100vh; display: flex; flex-direction: column; }
.header { height: 48px; background: var(--header); color: #fff; display: flex; align-items: center; padding: 0 8px 0 12px; gap: 4px; flex: none; }
.brand { display: flex; align-items: center; gap: 8px; padding-right: 10px; white-space: nowrap; cursor: pointer; }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; background: #fff; color: var(--header); display: grid; place-items: center; font-weight: 800; }
.brand b { font-size: 16px; letter-spacing: 1px; }
.brand em { font-style: normal; opacity: .85; font-weight: 600; margin-left: 4px; }
.topnav { display: flex; align-items: stretch; height: 48px; flex: 1; min-width: 0; }
.nav-item { position: relative; display: flex; align-items: center; padding: 0 13px; cursor: pointer; white-space: nowrap; }
.nav-item:hover, .nav-item.on { background: var(--header-active); }
.mega {
  display: none; position: absolute; top: 48px; left: 0; background: #fff; color: var(--text);
  box-shadow: var(--shadow); border-radius: 0 0 6px 6px; padding: 14px 8px 16px; z-index: 40;
  min-width: 180px;
}
.nav-item:hover .mega, .nav-item:focus-within .mega, .nav-item.open .mega { display: flex; gap: 6px; }
.mega-col { min-width: 148px; padding: 0 8px; }
.mega-col h4 { margin: 0 0 8px; color: var(--primary); font-size: 13px; font-weight: 700; }
.mega-col button { display: block; width: 100%; text-align: left; background: none; border: 0; color: #3a3f46; padding: 6px 8px; border-radius: 4px; }
.mega-col button:hover { background: var(--primary-soft); color: var(--primary); }
.header-tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.hbtn, .store-btn, .user-btn { background: transparent; border: 0; color: #fff; height: 32px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; }
.hbtn:hover, .store-btn:hover, .user-btn:hover { background: var(--header-active); }
.drop { position: relative; }
.drop-menu { display: none; position: absolute; right: 0; top: 36px; background: #fff; color: var(--text); min-width: 220px; border-radius: 6px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.drop:hover .drop-menu, .drop:focus-within .drop-menu { display: block; }
.drop-menu button, .drop-menu .drop-item { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 4px; color: var(--text); }
.drop-menu button:hover { background: var(--primary-soft); color: var(--primary); }
.avatar { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--header); display: grid; place-items: center; font-size: 12px; font-weight: 700; }

.tabbar { height: 40px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 8px; gap: 8px; flex: none; }
.tabs { display: flex; gap: 4px; overflow: auto; flex: 1; height: 100%; align-items: flex-end; }
.tab { border: 1px solid transparent; background: transparent; height: 30px; border-radius: 4px 4px 0 0; padding: 0 10px; color: #4e5560; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tab.on { background: var(--bg); border-color: #e6e8eb; border-bottom-color: var(--bg); color: var(--text); }
.tab .x { color: #98a0aa; border: 0; background: transparent; padding: 0; }
.tabtools { display: flex; gap: 10px; color: var(--sub); white-space: nowrap; align-items: center; }
.tabtools button { background: none; border: 0; color: var(--sub); padding: 0; }
.tabtools button:hover { color: var(--primary); }
.workspace { flex: 1; overflow: auto; padding: 12px; }
.watermark { position: fixed; inset: 0; pointer-events: none; z-index: 1; background-image: repeating-linear-gradient(-24deg, transparent, transparent 120px, rgba(242,107,29,.015) 120px, rgba(242,107,29,.015) 121px); }

/* home */
.home-grid { display: grid; grid-template-columns: 1fr 280px; gap: 12px; align-items: start; }
.card { background: #fff; border-radius: 4px; padding: 14px 16px; }
.hello { display: flex; justify-content: space-between; align-items: center; }
.hello b { font-size: 16px; }
.hello span { color: var(--muted); margin-left: 8px; }
.chips { display: flex; gap: 0; margin: 12px 0; }
.chips button { background: #fff; border: 1px solid #e5e6eb; padding: 4px 14px; color: #4e5560; }
.chips button + button { margin-left: -1px; }
.chips button.on { color: var(--primary); border-color: var(--primary); position: relative; z-index: 1; }
.kpis { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 8px; }
.kpi .lbl { color: var(--sub); }
.kpi .num { font-size: 22px; font-weight: 700; margin: 6px 0; }
.kpi .sub { color: var(--muted); font-size: 12px; line-height: 1.6; }
.down { color: var(--danger); }
.up { color: var(--ok); }
.section-title { font-weight: 700; margin-bottom: 10px; }
.risk-legend { color: var(--sub); font-size: 12px; display: flex; gap: 14px; margin-bottom: 8px; }
.dot { width: 8px; height: 8px; display: inline-block; margin-right: 4px; }
.risks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.risk { border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; min-height: 92px; }
.risk.warn { background: #fff6f6; border-color: #ffd6d6; }
.risk .n { font-size: 26px; font-weight: 700; }
.risk .hint { color: var(--danger); font-size: 12px; }
.charts { display: grid; grid-template-columns: 1.1fr .9fr 1fr; gap: 12px; margin-top: 12px; }
.donut-wrap { display: flex; gap: 12px; align-items: center; min-height: 150px; }
.donut { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut i { width: 78px; height: 78px; border-radius: 50%; background: #fff; display: grid; place-items: center; text-align: center; font-style: normal; font-size: 12px; color: var(--sub); line-height: 1.3; }
.legend { font-size: 12px; color: var(--sub); line-height: 1.9; }
.legend b { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.side-card { margin-bottom: 12px; }
.side-card h3 { margin: 0 0 8px; font-size: 15px; }
.train-item { display: block; color: var(--primary); padding: 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; background: none; border: 0; width: 100%; text-align: left; }
.muted { color: var(--muted); }
.phone { font-size: 20px; font-weight: 700; color: var(--primary-dark); }

/* list */
.panel { background: #fff; border-radius: 4px; padding: 12px 14px 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.filters label { color: var(--sub); display: inline-flex; align-items: center; gap: 6px; }
.filters input, .filters select, .modal input, .modal select, .modal textarea, .form-grid input, .form-grid select, .form-grid textarea {
  height: 32px; border: 1px solid #dcdfe6; border-radius: 4px; padding: 0 8px; outline: none; background: #fff; color: var(--text);
}
.filters input:focus, .filters select:focus, .modal input:focus, .modal select:focus, .form-grid input:focus, .form-grid select:focus { border-color: var(--primary); }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; gap: 8px; }
.toolbar .left, .toolbar .right { display: flex; gap: 8px; align-items: center; }
.table-wrap { overflow: auto; border: 1px solid #f0f0f0; }
table.data { width: 100%; border-collapse: collapse; min-width: 860px; }
table.data th, table.data td { border-bottom: 1px solid #f2f3f5; padding: 8px 10px; text-align: left; white-space: nowrap; }
table.data th { background: #fafafa; font-weight: 600; position: sticky; top: 0; z-index: 1; }
table.data tr:hover td { background: #fffaf6; }
table.data .ops button { background: none; border: 0; color: var(--primary); padding: 0 4px; }
table.data .ops button.danger { color: var(--danger); }
.tag { display: inline-block; padding: 0 8px; height: 22px; line-height: 22px; border-radius: 3px; font-size: 12px; background: #f2f3f5; color: #4e5969; }
.tag.待审核, .tag.审核中 { background: #fff1e8; color: #d85a12; }
.tag.已审核, .tag.已通过 { background: #e8f3ff; color: #1677ff; }
.tag.已完成, .tag.启用, .tag.在营, .tag.正常 { background: #e8f8f2; color: #0d9f6e; }
.tag.已作废, .tag.驳回, .tag.停用, .tag.不合格 { background: #fdecee; color: #e34d59; }
.tag.草稿 { background: #f2f3f5; color: #4e5969; }
.tag.重大, .tag.高 { background: #fdecee; color: #e34d59; }
.tag.较大, .tag.中 { background: #fff1e8; color: #d85a12; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 10px 0 4px; color: var(--sub); }
.pager button { min-width: 28px; height: 28px; border: 1px solid #e5e6eb; background: #fff; border-radius: 4px; }
.pager button.on { border-color: var(--primary); color: var(--primary); }
.crumbs { color: var(--muted); margin-bottom: 8px; }
.crumbs b { color: var(--text); font-weight: 600; }

/* modal */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 6px; width: min(980px, 100%); box-shadow: var(--shadow); }
.modal header, .drawer header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 700; }
.modal .body, .drawer .body { padding: 14px 16px; }
.modal footer, .drawer footer { padding: 10px 16px 14px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label, .set-grid label { display: flex; flex-direction: column; gap: 4px; color: var(--sub); }
.xbtn { border: 0; background: transparent; font-size: 18px; color: #98a0aa; }
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 70; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(640px, 100%); background: #fff; z-index: 71; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.drawer .body { overflow: auto; flex: 1; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 8px; margin-bottom: 12px; }
.kv span { color: var(--muted); }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 4px; box-shadow: var(--shadow); padding: 10px 16px; z-index: 100; display: flex; align-items: center; gap: 8px; }
.palette { width: min(560px, 100%); margin-top: 10vh; }
.palette input { width: 100%; height: 40px; border: 0; border-bottom: 1px solid var(--line); padding: 0 14px; outline: none; }
.palette .hit { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 14px; }
.palette .hit:hover, .palette .hit.on { background: var(--primary-soft); }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.switch { display: inline-flex; align-items: center; gap: 8px; }
.guide ol { margin: 8px 0 0; padding-left: 18px; line-height: 1.8; }
.tags-print { display: flex; flex-wrap: wrap; gap: 10px; }
.price-tag { width: 180px; border: 1px dashed #e5b89a; padding: 8px; border-radius: 4px; }
.price-tag b { font-size: 20px; color: var(--primary-dark); }
.perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; }
.level-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.level-card { border: 1px solid var(--line); border-radius: 6px; padding: 12px; }
.level-card h3 { margin: 0 0 8px; color: var(--primary); }
.level-card input { width: 100%; height: 32px; border: 1px solid #dcdfe6; border-radius: 4px; margin-top: 4px; padding: 0 8px; }
.empty { text-align: center; color: var(--muted); padding: 28px 0; }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .home-grid { grid-template-columns: 1fr; }
  .charts { grid-template-columns: 1fr; }
  .risks, .level-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .login-banner { display: none; }
  .login-form { padding: 28px 20px; }
  .topnav { display: none; }
  .topnav.open { display: flex; flex-direction: column; position: absolute; top: 48px; left: 0; right: 0; background: var(--header); z-index: 60; height: auto; max-height: 70vh; overflow: auto; }
  .topnav.open .nav-item { width: 100%; flex-wrap: wrap; align-items: flex-start; }
  .topnav.open .mega { position: static; width: 100%; flex-wrap: wrap; box-shadow: none; background: #fff7f2; color: var(--text); }
  .topnav.open .nav-item.open .mega, .topnav.open .nav-item:hover .mega { display: flex; }
  .topnav.open .mega-col { min-width: 108px; flex: 1 1 108px; }
  .header { position: relative; }
  .menu-toggle { display: inline-flex !important; }
  #openSearch, .header-tools .drop:not(:first-child):not(:last-child) { display: none; }
  .store-btn { max-width: 148px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-btn { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
  .kpis, .form-grid, .perm-grid { grid-template-columns: 1fr 1fr; }
  .set-grid { grid-template-columns: 1fr; }
  .tabtools span.optional { display: none; }
}
.menu-toggle { display: none; }
@media print {
  .header, .tabbar, .toolbar, .filters, .pager, .mask, .no-print { display: none !important; }
  .workspace { overflow: visible; }
  body { background: #fff; }
}
