:root {
  --navy: #123d56;
  --blue: #0d628b;
  --blue-soft: #e9f3f8;
  --ink: #18303d;
  --muted: #6a7b84;
  --line: #dce7eb;
  --surface: #ffffff;
  --bg: #f4f7f8;
  --danger: #b34d4d;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 5.5vw; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-lockup, .topbar-actions, .secure-state { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; letter-spacing: .06em; }
.brand-mark.large { width: 60px; height: 60px; font-size: 15px; border-radius: 12px; }
.brand-name { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.brand-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { gap: 20px; }
.secure-state { gap: 7px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4e9a70; }
.icon-button, .close-button { border: 0; background: transparent; color: var(--muted); font-size: 20px; padding: 5px; }
.icon-button:hover, .close-button:hover { color: var(--blue); }
.logout-button { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 7px; padding: 8px 14px; font-size: 13px; }
.logout-button:hover, .secondary-button:hover { border-color: var(--blue); color: var(--blue); }

.main-content { width: min(1120px, 89vw); flex: 1; margin: 0 auto; padding: 60px 0 48px; }
.welcome-panel { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 46px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 13px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 13px; color: var(--navy); font-size: clamp(28px, 3.2vw, 42px); line-height: 1.25; letter-spacing: -.035em; }
.welcome-copy { margin-bottom: 0; color: var(--muted); font-size: 15px; }
.date-block { display: flex; flex-direction: column; align-items: flex-end; color: var(--navy); font-size: 14px; line-height: 1.7; }
.date-block small { color: var(--muted); font-variant-numeric: tabular-nums; }
.system-section { padding-top: 42px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 19px; }
h2 { margin-bottom: 0; color: var(--navy); font-size: 22px; letter-spacing: -.02em; }
.section-note { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.system-card { position: relative; display: flex; min-height: 164px; flex-direction: column; justify-content: space-between; padding: 24px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.system-card:hover { border-color: #9dc3d2; box-shadow: 0 10px 26px rgba(24, 65, 83, .08); transform: translateY(-2px); }
.system-card:active { transform: translateY(0); }
.system-card-head { display: flex; align-items: flex-start; gap: 14px; }
.system-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 18px; font-weight: 700; }
.system-card h3 { margin: 2px 0 8px; color: var(--navy); font-size: 17px; }
.system-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.system-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 19px; padding-top: 13px; border-top: 1px solid #edf2f4; }
.system-url { max-width: 82%; overflow: hidden; color: #8798a0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.arrow { color: var(--blue); font-size: 18px; }
.notice-strip { display: flex; align-items: center; gap: 10px; margin-top: 34px; padding: 13px 15px; background: #edf5f8; border-left: 3px solid #7aaabd; color: #53717d; }
.notice-strip p { margin: 0; font-size: 12px; line-height: 1.5; }
.notice-icon { width: 17px; height: 17px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #7aaabd; border-radius: 50%; font-size: 11px; font-weight: 700; }
.footer { display: flex; justify-content: space-between; padding: 0 5.5vw 23px; color: #98a6ac; font-size: 11px; }

.login-view { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: #f1f5f6; }
.login-card { width: min(420px, 100%); padding: 42px 44px 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(23, 57, 71, .08); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 32px; }
.login-kicker { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; line-height: 1.6; }
.login-card h1 { margin-bottom: 8px; font-size: 27px; }
.login-copy { color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-form { margin-top: 26px; }
label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 600; }
input { width: 100%; padding: 12px 13px; color: var(--ink); background: #fff; border: 1px solid #cbdce2; border-radius: 7px; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(13, 98, 139, .12); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 54px; }
.password-toggle { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue); font-size: 12px; }
.form-error { min-height: 18px; margin: 8px 0 0; color: var(--danger); font-size: 12px; }
.primary-button, .secondary-button { min-height: 42px; border-radius: 7px; font-size: 13px; font-weight: 700; }
.primary-button { width: 100%; margin-top: 12px; border: 1px solid var(--navy); background: var(--navy); color: #fff; }
.primary-button:hover { background: #1d5876; }
.login-hint { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: #8a999f; font-size: 11px; text-align: center; }
.login-hint strong { color: var(--navy); font-weight: 700; }
.login-footer { position: absolute; bottom: 20px; margin: 0; color: #97a6ab; font-size: 11px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 22px; background: rgba(18, 61, 86, .27); }
.modal { width: min(560px, 100%); max-height: min(720px, 90dvh); overflow: auto; padding: 28px; background: #fff; border-radius: 13px; box-shadow: 0 20px 60px rgba(18, 61, 86, .18); }
.auth-modal { width: min(430px, 100%); }
.auth-copy { margin: 18px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; }
.settings-tabs { display: flex; gap: 22px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.settings-tab { padding: 0 0 11px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.settings-tab.active { border-bottom-color: var(--blue); color: var(--blue); font-weight: 700; }
.settings-panel { padding-top: 19px; }
.manage-list { display: grid; gap: 10px; margin-bottom: 14px; }
.manage-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; padding: 10px; background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; }
.manage-row input { padding: 9px 10px; font-size: 12px; }
.small-button { padding: 8px 9px; border: 1px solid #e0c7c7; border-radius: 6px; background: #fff; color: var(--danger); font-size: 12px; }
.secondary-button { width: 100%; border: 1px solid #b9d3dc; background: #fff; color: var(--blue); }
.password-form { display: grid; gap: 8px; }
.password-form label { margin-top: 6px; }
.security-note { margin: 20px 0 0; padding: 12px; background: #f5f8f9; color: var(--muted); font-size: 12px; line-height: 1.6; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: calc(100vw - 48px); padding: 11px 15px; opacity: 0; pointer-events: none; background: var(--navy); color: #fff; border-radius: 7px; font-size: 12px; transition: opacity .2s ease, transform .2s ease; transform: translateY(8px); }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 680px) {
  .topbar { height: auto; min-height: 70px; padding: 14px 5vw; }
  .brand-subtitle, .secure-state { display: none; }
  .topbar-actions { gap: 10px; }
  .main-content { width: 90vw; padding-top: 38px; }
  .welcome-panel { align-items: flex-start; flex-direction: column; gap: 18px; padding-bottom: 31px; }
  .date-block { align-items: flex-start; }
  .system-grid { grid-template-columns: 1fr; }
  .system-card { min-height: 150px; }
  .footer { gap: 12px; padding-inline: 5vw; }
  .login-card { padding: 32px 24px 29px; }
  .manage-row { grid-template-columns: 1fr auto; }
  .manage-row input:first-child { grid-column: 1 / -1; }
  .modal { padding: 23px 18px; }
}
