:root {
    --bg: #f6f9fe;
    --panel: #ffffff;
    --text: #17233c;
    --muted: #71809b;
    --line: #e6edf7;
    --blue: #1f73ff;
    --blue-soft: #edf5ff;
    --green: #19b878;
    --orange: #ff8a18;
    --purple: #7357ff;
    --shadow: 0 12px 34px rgba(31, 57, 101, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft YaHei", sans-serif; }
a { color: inherit; text-decoration: none; }
input, select, button { font: inherit; }
.app { min-height: 100vh; display: grid; grid-template-columns: 284px 1fr; }
.sidebar { background: rgba(255,255,255,.92); border-right: 1px solid var(--line); padding: 26px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.logo { display: flex; align-items: center; gap: 12px; padding: 0 16px 30px; }
.logo span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #1b7aff, #1664e8); color: white; font-size: 16px; box-shadow: 0 8px 18px rgba(31,115,255,.28); }
.logo strong { font-size: 18px; letter-spacing: 0; color: #0f1f3a; }
nav { display: grid; gap: 9px; }
nav a { height: 52px; padding: 0 16px; border-radius: 8px; color: #50607c; display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 600; }
nav a span { width: 24px; color: #607393; font-size: 21px; text-align: center; }
nav a:hover, nav a:first-child { background: linear-gradient(90deg, #eaf3ff, #f5f9ff); color: var(--blue); }
nav a:hover span, nav a:first-child span { color: var(--blue); }
.system-card { margin-top: auto; border: 1px solid var(--line); border-radius: 12px; padding: 22px; min-height: 186px; background: linear-gradient(150deg, #f7fbff, #fff); box-shadow: var(--shadow); color: #41506c; }
.system-art { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; color: var(--blue); background: #eaf3ff; font-size: 25px; margin-bottom: 12px; }
.system-card strong { color: #17233c; }
.system-card p { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.mini-dots { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.mini-dots i { width: 9px; height: 9px; border-radius: 50%; background: #dce6f4; }
.mini-dots i:first-child { width: 24px; border-radius: 999px; background: #8eb9ff; }
.mini-dots b { width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--green); }
.main { padding: 0; overflow: auto; }
.topbar { height: 86px; padding: 0 28px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.title-tabs { display: flex; align-items: center; gap: 30px; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: 0; color: #10192d; white-space: nowrap; }
.tabs { display: flex; gap: 10px; }
.tabs a { height: 42px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 8px; background: #f2f5fb; color: #26364f; font-weight: 700; }
.tabs a.active { color: var(--blue); background: #e7f0ff; box-shadow: inset 0 -2px 0 rgba(31,115,255,.18); }
.top-actions { display: flex; align-items: center; gap: 14px; min-width: 0; }
.search-box { width: 330px; height: 42px; border: 1px solid #dbe5f2; border-radius: 8px; background: white; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #8a98af; }
.search-box input { border: 0; outline: 0; padding: 0; min-height: 0; flex: 1; color: var(--text); background: transparent; }
.date-box { height: 42px; min-width: 260px; border: 1px solid #dbe5f2; border-radius: 8px; background: white; color: #1c2b45; font-weight: 600; }
.bell { width: 42px; height: 42px; border: 0; background: transparent; position: relative; color: #2d3d59; font-size: 24px; }
.bell em { position: absolute; top: 6px; right: 5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #e02525; color: white; font-size: 11px; font-style: normal; line-height: 18px; }
.user-chip { display: grid; grid-template-columns: 42px auto; column-gap: 10px; align-items: center; }
.avatar { grid-row: span 2; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #223a62, #4b86ff); font-weight: 800; }
.user-chip strong { font-size: 15px; }
.user-chip small { color: var(--green); font-size: 12px; }
.metric-row, .dashboard-grid, .panel { margin-left: 28px; margin-right: 28px; }
.metric-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; padding-top: 22px; margin-bottom: 18px; }
.metric, .panel, .hero-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.metric { min-height: 128px; padding: 24px 18px 18px 96px; position: relative; overflow: hidden; }
.metric i { position: absolute; left: 24px; top: 26px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 29px; }
.metric i.blue { background: #e8f2ff; color: var(--blue); }
.metric i.green { background: #e4f8f1; color: var(--green); }
.metric i.orange { background: #fff1df; color: var(--orange); }
.metric i.purple { background: #eeeaff; color: var(--purple); }
.metric p { margin: 0; color: #4e5b74; font-weight: 700; }
.metric strong { display: block; margin-top: 3px; font-size: 28px; line-height: 1.1; letter-spacing: 0; color: #121a2b; }
.metric small { display: block; margin-top: 6px; color: var(--green); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: 1.45fr .9fr 1.05fr; gap: 18px; margin-bottom: 18px; }
.panel { padding: 22px; margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel h2, .hero-panel h2 { margin: 0; font-size: 18px; color: #10192d; letter-spacing: 0; }
.btn { border: 1px solid #dbe5f2; border-radius: 8px; padding: 9px 14px; background: white; color: #2a3a56; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; font-weight: 700; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: white; box-shadow: 0 8px 20px rgba(31,115,255,.18); }
.btn.small { padding: 7px 11px; min-height: 32px; font-size: 13px; }
.line-chart { height: 300px; }
.line-chart svg { width: 100%; height: 260px; }
.grid-lines path { stroke: #e7edf6; stroke-width: 1; stroke-dasharray: 4 4; fill: none; }
.area { fill: url(#fillBlue); }
.line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.blue-line { stroke: var(--blue); }
.green-line { stroke: var(--green); }
.orange-line { stroke: var(--orange); }
.chart-labels { display: grid; grid-template-columns: repeat(7, 1fr); color: #71809b; font-weight: 600; font-size: 13px; padding: 0 10px 0 36px; }
.donut-wrap { display: grid; grid-template-columns: 1fr .8fr; align-items: center; gap: 20px; min-height: 250px; }
.donut { width: 190px; height: 190px; margin: auto; border-radius: 50%; background: conic-gradient(var(--blue) 0 52%, #58d0a2 52% 100%); display: grid; place-items: center; position: relative; }
.donut:after { content: ""; position: absolute; inset: 38px; background: white; border-radius: 50%; }
.donut strong, .donut span { position: relative; z-index: 1; grid-area: 1/1; }
.donut strong { font-size: 28px; align-self: center; transform: translateY(-10px); }
.donut span { color: var(--muted); align-self: center; transform: translateY(22px); }
.legend p { margin: 18px 0; color: #53627c; }
.legend strong { display: block; margin-left: 22px; margin-top: 4px; font-size: 20px; color: #13203a; }
.dot-blue, .dot-green { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; }
.dot-blue { background: var(--blue); }
.dot-green { background: var(--green); }
.rank-row { display: grid; grid-template-columns: 22px 1fr 1.2fr 54px; gap: 12px; align-items: center; margin: 16px 0; color: #41506c; }
.rank-row p { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank-row div { height: 5px; border-radius: 999px; background: #e9eef6; overflow: hidden; }
.rank-row i { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.rank-row strong { text-align: right; font-size: 13px; }
.quick-links { display: grid; gap: 14px; }
.quick-links a { height: 48px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; padding: 0 16px; color: #29415f; font-weight: 800; background: linear-gradient(90deg, #fbfdff, #f4f8ff); }
.quick-links a:hover { color: var(--blue); border-color: #bfd7ff; }
.bottom-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; margin: 0 28px 18px; }
.bottom-grid .panel { margin: 0; }
.side-stack { display: grid; gap: 18px; }
.link-more { color: var(--blue); font-weight: 800; font-size: 13px; }
.mini-panel { padding-bottom: 14px; }
.health-row { display: grid; grid-template-columns: 1fr 54px .9fr 56px; gap: 12px; align-items: center; padding: 9px 0; color: #354762; }
.health-row b { text-align: center; border-radius: 999px; font-size: 12px; padding: 3px 8px; }
.health-row b.ok { color: var(--green); background: #e5f8f0; }
.health-row b.bad { color: #e04444; background: #ffecec; }
.health-row i, .hit-row i { height: 5px; background: #e9eef6; border-radius: 999px; overflow: hidden; }
.health-row em, .hit-row em { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.health-row:nth-child(3) em { background: var(--orange); }
.health-row strong, .hit-row strong { text-align: right; color: #30425f; font-size: 13px; }
.hit-row { display: grid; grid-template-columns: 1fr 1fr 60px; gap: 14px; align-items: center; padding: 9px 0; color: #354762; }
.hit-row em { background: var(--blue); }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: #6d7b94; font-weight: 700; background: #f8fbff; }
tr:hover td { background: #fbfdff; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; background: #eaf3ff; color: var(--blue); font-size: 12px; font-weight: 700; }
.badge.accent { background: #e7f8f0; color: var(--green); }
code { background: #f2f6fb; border: 1px solid #dfe7f1; padding: 3px 7px; border-radius: 6px; color: #27548a; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
label { display: grid; gap: 6px; color: #5c6b84; font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; background: white; color: var(--text); outline: none; min-height: 40px; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,115,255,.12); }
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.check input { width: auto; min-height: auto; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { min-width: 110px; }
.actions { display: flex; gap: 10px; align-items: center; }
.link-btn { border: 0; background: transparent; color: var(--blue); font-weight: 800; cursor: pointer; padding: 4px 0; }
.link-btn.danger { color: #df3d3d; }
.btn.danger { background: #df3d3d; border-color: #df3d3d; color: white; }
.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 31, 58, .36); backdrop-filter: blur(7px); }
.modal.show { display: flex; }
.modal-card { width: min(620px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 80px rgba(16, 31, 58, .24); }
.modal-card.small-card { width: min(440px, 100%); }
.modal-head { height: 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 19px; color: #10192d; }
.modal-head button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: #f2f6fb; color: #60708d; font-size: 22px; cursor: pointer; }
.modal-form { padding: 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.small-card .modal-form { grid-template-columns: 1fr; }
.full-field, .proxy-check-result { grid-column: 1 / -1; }
.modal-text { grid-column: 1 / -1; margin: 0; color: #4c5b73; }
.modal-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 12px; padding-top: 8px; }
.proxy-check-result { border: 1px dashed #cfdced; border-radius: 10px; background: #f8fbff; padding: 12px; color: #60708d; font-weight: 600; }
.check-summary { margin-bottom: 10px; color: #203451; font-weight: 800; }
.check-row { display: grid; grid-template-columns: 80px 70px 70px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid #e7eef7; }
.check-row strong { color: #17233c; }
.check-row span { justify-self: start; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 800; }
.check-row.ok span { background: #e5f8f0; color: var(--green); }
.check-row.bad span { background: #ffecec; color: #df3d3d; }
.check-row em { color: #344966; font-style: normal; font-weight: 800; }
.check-row small { color: #71809b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-error { color: #df3d3d; font-weight: 800; }
.check-loading { color: var(--blue); font-weight: 800; }
.hero-panel { margin: 0 28px 18px; padding: 26px; display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.hero-panel p { color: var(--muted); margin: 8px 0 0; }
.auth-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(140deg, #edf5ff, #f8fbff 52%, #e7f8f0); }
.auth-shell { width: min(920px, calc(100% - 32px)); display: grid; grid-template-columns: 1.1fr .9fr; background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 80px rgba(31,57,101,.16); }
.auth-brand { padding: 54px; color: #102044; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(150deg, #f0f7ff, #fff); }
.brand-mark { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--blue); color: white; font-weight: 800; }
.auth-brand h1 { font-size: 34px; margin: 22px 0 8px; letter-spacing: 0; }
.auth-brand p, .muted { color: var(--muted); margin-top: 0; }
.auth-card { background: white; padding: 42px; }
.auth-card h2 { margin: 0 0 8px; font-size: 24px; }
.stack { display: grid; gap: 16px; margin-top: 24px; }
.alert { color: #8a2f2f; background: #fff1f1; border: 1px solid #ffd1d1; border-radius: 8px; padding: 10px 12px; margin-top: 16px; }
.switch-link { display: inline-block; margin-top: 18px; color: var(--blue); font-weight: 700; }
@media (max-width: 1400px) {
    .metric-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .system-card { display: none; }
    nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar { height: auto; padding: 18px; align-items: flex-start; flex-direction: column; gap: 14px; }
    .top-actions { flex-wrap: wrap; }
    .search-box, .date-box { width: 100%; min-width: 0; }
    .metric-row, .form-grid, .auth-shell { grid-template-columns: 1fr; }
    .metric-row, .dashboard-grid, .panel { margin-left: 18px; margin-right: 18px; }
    .bottom-grid { grid-template-columns: 1fr; margin-left: 18px; margin-right: 18px; }
    .panel { overflow-x: auto; }
}
