:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f1f3f6;
  --surface-hover: #f8f9fb;
  --text: #17191e;
  --text-soft: #454a55;
  --muted: #747a86;
  --muted-light: #9da3ae;
  --line: #e6e8ed;
  --line-strong: #d9dde5;
  --accent: #4059e8;
  --accent-hover: #334bd2;
  --accent-soft: #eef0ff;
  --green: #16875f;
  --green-soft: #eaf7f1;
  --warning: #b67815;
  --warning-soft: #fff7e8;
  --danger: #cf4356;
  --danger-soft: #fff0f2;
  --shadow-sm: 0 1px 2px rgba(18, 24, 40, .04), 0 4px 14px rgba(18, 24, 40, .035);
  --shadow-md: 0 14px 40px rgba(18, 24, 40, .09), 0 2px 8px rgba(18, 24, 40, .05);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .56; }
[hidden] { display: none !important; }
::selection { color: #fff; background: rgba(64, 89, 232, .82); }
:focus-visible { outline: 3px solid rgba(64, 89, 232, .22); outline-offset: 2px; }

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2bb783;
  box-shadow: 0 0 0 4px rgba(43, 183, 131, .12);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #526cf2, #3349bd);
  box-shadow: 0 9px 24px rgba(64, 89, 232, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.primary-button { border: 1px solid var(--accent); color: #fff; background: var(--accent); box-shadow: 0 6px 16px rgba(64, 89, 232, .18); }
.primary-button:hover:not(:disabled) { background: var(--accent-hover); box-shadow: 0 8px 22px rgba(64, 89, 232, .24); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line-strong); color: var(--text-soft); background: var(--surface); }
.secondary-button:hover:not(:disabled) { border-color: #c6cad3; color: var(--text); background: var(--surface-hover); }
.danger-button { border: 1px solid var(--danger); color: #fff; background: var(--danger); }
.danger-button:hover:not(:disabled) { background: #b93649; }

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.icon-button:hover { border-color: var(--line); color: var(--text); background: var(--surface-soft); }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Login */

.login-body {
  min-height: 100vh;
  overflow: hidden;
  color: #eef1f8;
  background:
    radial-gradient(circle at 18% 82%, rgba(45, 131, 154, .22), transparent 31%),
    radial-gradient(circle at 82% 14%, rgba(67, 74, 175, .24), transparent 34%),
    #0b0f16;
}

.particle-canvas { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .34; }
.aurora { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(90px); }
.aurora-one { top: -22%; right: -8%; width: 520px; height: 520px; background: rgba(64, 89, 232, .12); animation: aurora-drift 12s ease-in-out infinite alternate; }
.aurora-two { bottom: -30%; left: -10%; width: 580px; height: 580px; background: rgba(27, 164, 152, .1); animation: aurora-drift 15s ease-in-out infinite alternate-reverse; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .04; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }

.login-layout {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px 22px;
}

.login-panel-wrap { width: min(430px, 100%); perspective: 1200px; }
.login-panel {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 24px;
  color: var(--text);
  background: rgba(255, 255, 255, .965);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .38), inset 0 1px 0 #fff;
  transform-style: preserve-3d;
  transition: transform .16s ease-out;
}
.panel-glow { position: absolute; top: -120px; right: -100px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none; background: rgba(64, 89, 232, .1); filter: blur(54px); }

.login-panel .brand-lockup { position: relative; display: flex; align-items: center; gap: 13px; margin-bottom: 42px; }
.brand-word { display: flex; flex-direction: column; gap: 2px; }
.brand-word strong { color: #17191e; font-size: 18px; font-weight: 740; letter-spacing: -.02em; }
.brand-word small { color: var(--muted); font-size: 12px; }

.login-header { position: relative; margin-bottom: 28px; }
.login-header h1 { margin: 0 0 9px; font-size: 30px; font-weight: 730; letter-spacing: -.045em; }
.login-header p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.login-form { display: grid; gap: 18px; }

.field { display: grid; gap: 8px; }
.field > span:first-child { color: var(--text-soft); font-size: 13px; font-weight: 600; }
.input-shell {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fafbfc;
  transition: border-color .17s ease, background .17s ease, box-shadow .17s ease;
}
.input-shell:focus-within { border-color: rgba(64, 89, 232, .62); background: #fff; box-shadow: 0 0 0 4px rgba(64, 89, 232, .09); }
.input-shell > svg { width: 19px; flex: 0 0 auto; fill: none; stroke: #8b919d; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.input-shell input,
.input-shell textarea,
.input-shell select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 14px;
}
.input-shell input::placeholder,
.input-shell textarea::placeholder { color: #afb4bd; }
.input-shell textarea { resize: vertical; line-height: 1.65; }
.textarea-shell { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.password-toggle { display: grid; width: 34px; height: 34px; flex: 0 0 auto; padding: 0; place-items: center; border: 0; border-radius: 8px; color: #858b96; background: transparent; cursor: pointer; }
.password-toggle:hover { color: var(--text); background: var(--surface-soft); }
.password-toggle svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-message, .form-message { min-height: 20px; color: var(--danger); font-size: 13px; line-height: 1.55; }
.login-message { margin-top: -5px; }
.login-message.success { color: var(--green); }
.login-button { position: relative; width: 100%; min-height: 50px; margin-top: -2px; border-radius: 11px; font-size: 15px; }
.login-button > svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.button-loader { display: none; width: 19px; height: 19px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.login-button.loading .button-loader { display: block; }
.login-button.loading .button-label, .login-button.loading > svg { display: none; }

.login-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.login-footer > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.login-footer .status-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px rgba(43, 183, 131, .1); }
.login-note { margin: 18px 0 0; color: rgba(234, 238, 247, .56); font-size: 12px; text-align: center; }
.login-panel.shake { animation: shake .38s ease; }

/* Application shell */

.app-body { height: 100vh; overflow: hidden; background: var(--bg); }
.app-backdrop { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 95% 0, rgba(64, 89, 232, .045), transparent 28%); }
.app-shell { position: relative; display: grid; height: 100vh; grid-template-columns: 232px minmax(0, 1fr); }

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 11px; font-size: 17px; box-shadow: 0 6px 18px rgba(64, 89, 232, .2); }
.sidebar-brand > div { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.sidebar-brand strong { font-size: 17px; font-weight: 740; letter-spacing: -.025em; }
.sidebar-brand span:last-child { color: var(--muted); font-size: 11px; }

.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav > p { display: none; }
.sidebar-nav a {
  position: relative;
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border-radius: 11px;
  color: #616773;
  font-size: 14px;
  font-weight: 560;
  text-decoration: none;
  transition: color .17s ease, background .17s ease, transform .17s ease;
}
.sidebar-nav a svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav a:hover { color: var(--text); background: var(--surface-soft); transform: translateX(2px); }
.sidebar-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.sidebar-nav a.active::after { position: absolute; right: 10px; width: 5px; height: 5px; border-radius: 50%; content: ""; background: var(--accent); }

.sidebar-status { display: flex; align-items: center; gap: 11px; margin-top: auto; padding: 14px 12px 4px; border-top: 1px solid var(--line); }
.sidebar-status > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.sidebar-status strong { font-size: 12px; font-weight: 650; }
.sidebar-status div span { color: var(--muted); font-size: 11px; }
.sidebar-overlay { display: none; }

.workspace { display: grid; min-width: 0; min-height: 0; grid-template-rows: 72px minmax(0, 1fr); }
.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(16px);
}
.menu-button { display: none; }
.topbar-context { display: flex; flex-direction: column; }
.topbar-context strong { font-size: 18px; font-weight: 690; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.clock { display: flex; min-width: 105px; flex-direction: column; align-items: flex-end; gap: 1px; padding-right: 14px; border-right: 1px solid var(--line); }
.clock span { font-size: 14px; font-weight: 680; font-variant-numeric: tabular-nums; }
.clock small { color: var(--muted); font-size: 11px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 750; }
.user-chip > div { display: flex; flex-direction: column; gap: 1px; }
.user-chip strong { font-size: 13px; font-weight: 650; }
.user-chip small { color: var(--muted); font-size: 11px; }
.logout-button { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.logout-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logout-button:hover { border-color: var(--line); color: var(--text); background: var(--surface-soft); }

.content { min-width: 0; overflow-y: auto; padding: 38px 42px 64px; }
.view { width: min(1320px, 100%); margin: 0 auto; }
.view-enter { animation: view-in .24s ease both; }

.hero-row, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.hero-row h1, .page-heading h1 { margin: 0 0 8px; font-size: clamp(28px, 3vw, 34px); font-weight: 720; letter-spacing: -.045em; }
.hero-row p, .page-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.home-heading { align-items: center; margin-bottom: 30px; }
.hero-pulse { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid #dbece5; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 12px; font-weight: 600; }
.hero-pulse i { width: 7px; height: 7px; border-radius: 50%; background: #29ad7c; box-shadow: 0 0 0 4px rgba(41, 173, 124, .11); }
.hero-pulse b { font-weight: 750; }

.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.module-card {
  display: grid;
  min-height: 112px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.module-card:hover { border-color: #d4d8e3; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.module-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; color: var(--accent); background: var(--accent-soft); }
.module-icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.module-copy { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.module-copy strong { font-size: 15px; font-weight: 680; }
.module-copy small { color: var(--muted); font-size: 12px; }
.module-copy b { color: var(--text-soft); font-weight: 750; }
.module-card > i { color: var(--muted-light); font-size: 20px; font-style: normal; transition: color .18s ease, transform .18s ease; }
.module-card:hover > i { color: var(--accent); transform: translateX(3px); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.panel-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-card > header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-card > header h2 { margin: 0; font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.panel-card > header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-card > header a { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.panel-card > header a:hover { text-decoration: underline; text-underline-offset: 3px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 17px; color: #858b96; background: #fbfbfc; font-size: 12px; font-weight: 620; letter-spacing: .01em; text-align: left; white-space: nowrap; }
td { padding: 15px 17px; border-top: 1px solid #eef0f3; color: var(--text-soft); font-size: 13px; line-height: 1.45; vertical-align: middle; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #fafbfc; }
.align-right { text-align: right; }
.cell-main { display: block; color: var(--text); font-weight: 610; }
.cell-sub { display: block; max-width: 320px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.service-link { max-width: 320px; overflow: hidden; color: var(--accent); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.service-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.badge { display: inline-flex; min-height: 25px; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid #d9ede4; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 650; white-space: nowrap; }
.badge::before { width: 5px; height: 5px; border-radius: 50%; content: ""; background: currentColor; }
.badge.warn { border-color: #f0dfba; color: var(--warning); background: var(--warning-soft); }
.badge.error { border-color: #f1ccd2; color: var(--danger); background: var(--danger-soft); }
.env-production { border-color: #d9ede4; color: var(--green); background: var(--green-soft); }
.env-test { border-color: #dce1fa; color: var(--accent); background: var(--accent-soft); }
.env-development { border-color: #e7dcf5; color: #7b4eb1; background: #f6effd; }

.panel-toolbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.search-box { display: flex; width: min(390px, 100%); min-height: 42px; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fafbfc; transition: border-color .17s ease, box-shadow .17s ease, background .17s ease; }
.search-box:focus-within { border-color: rgba(64, 89, 232, .55); background: #fff; box-shadow: 0 0 0 4px rgba(64, 89, 232, .08); }
.search-box svg { width: 18px; fill: none; stroke: #858b96; stroke-width: 1.7; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #a8adb7; }
.filter-group { display: flex; align-items: center; gap: 9px; }
.filter-group label { color: var(--muted); font-size: 12px; }
.filter-group select { min-width: 106px; height: 39px; padding: 0 30px 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; outline: 0; color: var(--text-soft); background: #fff; font-size: 13px; }

.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.table-action { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text-soft); background: #fff; cursor: pointer; font-size: 12px; font-weight: 580; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.table-action:hover:not(:disabled) { border-color: #bfc6ef; color: var(--accent); background: var(--accent-soft); }
.table-action.danger:hover:not(:disabled) { border-color: #edc4cb; color: var(--danger); background: var(--danger-soft); }

.empty-state { display: grid; min-height: 250px; place-items: center; align-content: center; gap: 8px; padding: 28px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; width: 48px; height: 48px; margin-bottom: 3px; place-items: center; border-radius: 14px; color: var(--accent); background: var(--accent-soft); font-size: 22px; }
.empty-state strong { color: var(--text-soft); font-size: 14px; font-weight: 650; }
.empty-state p { margin: 0; font-size: 12px; }

/* Logs */

.log-tabs { display: inline-flex; gap: 4px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #eceef2; }
.log-tabs button { display: inline-flex; min-height: 36px; align-items: center; gap: 8px; padding: 0 13px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; }
.log-tabs button span { display: inline-grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 999px; color: var(--muted); background: rgba(0, 0, 0, .055); font-size: 10px; }
.log-tabs button.active { color: var(--text); background: #fff; box-shadow: 0 1px 4px rgba(19, 25, 40, .09); }
.log-tabs button.active span { color: var(--accent); background: var(--accent-soft); }
.log-panel { min-height: 300px; }

/* Downloads */

.download-groups { display: grid; gap: 16px; }
.download-group { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.download-group > header { display: flex; align-items: center; gap: 13px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.download-group > header > span { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; color: var(--accent); background: var(--accent-soft); font-size: 13px; font-weight: 750; }
.download-group > header > div { display: flex; flex-direction: column; gap: 3px; }
.download-group h2 { margin: 0; font-size: 16px; font-weight: 680; }
.download-group header small { color: var(--muted); font-size: 12px; }
.download-list { display: grid; }
.download-item { display: grid; grid-template-columns: minmax(230px, 1.2fr) 120px minmax(220px, 1fr) auto; align-items: center; gap: 18px; padding: 17px 20px; border-top: 1px solid #eef0f3; }
.download-item:first-child { border-top: 0; }
.download-item:hover { background: #fafbfc; }
.download-item > div { min-width: 0; }
.download-item strong { display: block; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.download-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.download-hash { overflow: hidden; color: #838995; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.download-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.hash-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--muted); background: #fff; cursor: pointer; font-size: 11px; }
.hash-button:hover { color: var(--text); background: var(--surface-soft); }
.download-button { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--accent); border-radius: 8px; color: #fff; background: var(--accent); font-size: 12px; font-weight: 620; text-decoration: none; white-space: nowrap; }
.download-button:hover { background: var(--accent-hover); }

/* Dialogs */

.modal { width: min(650px, calc(100% - 28px)); max-height: calc(100vh - 36px); padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 20px; color: var(--text); background: #fff; box-shadow: 0 34px 100px rgba(18, 24, 40, .24); }
.modal::backdrop { background: rgba(22, 26, 35, .48); backdrop-filter: blur(5px); }
.modal[open] { animation: modal-in .2s ease both; }
.modal > form, .secret-modal > div, .confirm-modal > div { padding: 27px; }
.modal header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.modal h2 { margin: 0; font-size: 23px; font-weight: 720; letter-spacing: -.035em; }
.modal header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.modal header .icon-button { margin: -5px -5px 0 0; font-size: 23px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.modal-grid .full { grid-column: 1 / -1; }
.modal .input-shell { min-height: 46px; background: #fafbfc; }
.modal footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--line); }
.form-message { margin-top: 12px; }
.secret-modal { width: min(570px, calc(100% - 28px)); }
.secret-hint { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0; color: var(--muted); font-size: 12px; }
.secret-hint span { color: var(--warning); white-space: nowrap; }
.secret-modal pre { min-height: 110px; max-height: 340px; margin: 17px 0 0; padding: 17px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; color: #e8ecf4; background: #171b24; font: 13px/1.7 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; word-break: break-all; }

.confirm-modal { width: min(420px, calc(100% - 28px)); text-align: center; }
.confirm-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 16px; place-items: center; border-radius: 50%; color: var(--danger); background: var(--danger-soft); font-size: 21px; font-weight: 750; }
.confirm-modal h2 { font-size: 21px; }
.confirm-modal p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.confirm-modal footer { justify-content: center; }
.confirm-modal footer button { min-width: 110px; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: 22px; display: grid; width: min(350px, calc(100% - 44px)); gap: 9px; }
.toast { padding: 13px 15px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 11px; color: #f5f7fb; background: rgba(27, 31, 40, .95); box-shadow: 0 16px 45px rgba(18, 24, 40, .25); font-size: 13px; line-height: 1.5; animation: toast-in .23s ease both; }
.toast.success { border-left: 3px solid #31b987; }
.toast.error { border-left: 3px solid #e15b6d; }

@keyframes aurora-drift { from { transform: translate3d(-4%, -2%, 0) scale(.95); } to { transform: translate3d(6%, 5%, 0) scale(1.08); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 215px minmax(0, 1fr); }
  .content { padding: 32px 30px 56px; }
  .topbar { padding: 0 25px; }
  .module-card { padding: 17px; }
  .download-item { grid-template-columns: minmax(210px, 1fr) 100px minmax(180px, .8fr) auto; gap: 13px; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 232px; transform: translateX(-102%); box-shadow: 18px 0 55px rgba(18, 24, 40, .15); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; z-index: 15; inset: 0; display: block; pointer-events: none; background: rgba(18, 23, 32, .35); opacity: 0; transition: opacity .2s ease; }
  .sidebar-overlay.visible { pointer-events: auto; opacity: 1; }
  .workspace { height: 100vh; }
  .menu-button { display: grid; }
  .content { padding: 28px 24px 50px; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 92px; }
  .download-item { grid-template-columns: minmax(0, 1fr) auto; }
  .download-item > div:nth-child(2), .download-hash { display: none; }
  .download-actions { grid-column: 2; grid-row: 1; }
  .hash-button { display: none; }
}

@media (max-width: 640px) {
  .topbar { height: 66px; padding: 0 15px; }
  .workspace { grid-template-rows: 66px minmax(0, 1fr); }
  .topbar-context strong { font-size: 16px; }
  .clock { display: none; }
  .user-chip > div { display: none; }
  .logout-button { width: 38px; padding: 0; justify-content: center; }
  .logout-button span { display: none; }
  .content { padding: 24px 16px 44px; }
  .hero-row, .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 22px; }
  .hero-row h1, .page-heading h1 { font-size: 27px; }
  .home-heading { gap: 16px; }
  .module-grid { gap: 10px; }
  .panel-card, .download-group { border-radius: 14px; }
  .panel-card > header { min-height: 66px; padding: 14px 16px; }
  .panel-toolbar { min-height: auto; align-items: stretch; flex-direction: column; padding: 13px; }
  .search-box { width: 100%; }
  th, td { padding-right: 14px; padding-left: 14px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-grid .full { grid-column: auto; }
  .modal > form, .secret-modal > div, .confirm-modal > div { padding: 22px; }
  .secret-hint { align-items: flex-start; flex-direction: column; gap: 5px; }
  .log-tabs { display: flex; width: 100%; }
  .log-tabs button { flex: 1; justify-content: center; }
  .download-group > header { padding: 16px; }
  .download-item { padding: 15px 16px; }
  .toast-region { right: 14px; bottom: 14px; width: calc(100% - 28px); }
}

@media (max-width: 480px) {
  .login-layout { padding: 18px 14px; }
  .login-panel { padding: 27px 22px; border-radius: 20px; }
  .login-panel .brand-lockup { margin-bottom: 34px; }
  .login-header h1 { font-size: 27px; }
  .login-footer { margin-top: 24px; }
  .module-icon { width: 42px; height: 42px; }
  .row-actions { gap: 4px; }
  .table-action { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .particle-canvas { opacity: .18; }
}
