:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #66758d;
  --line: #dfe6ef;
  --blue: #0866d9;
  --blue-dark: #054ea8;
  --cyan: #e9f4ff;
  --green: #117a53;
  --red: #b4233b;
  --shadow: 0 16px 44px rgba(31, 53, 86, .09);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif; }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
.topbar { height: 66px; padding: 0 max(22px, calc((100vw - 1240px)/2)); display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(12px); }
.brand { font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-size: 19px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.user-chip { padding: 7px 11px; background: var(--cyan); border-radius: 999px; color: #175188; font-size: 13px; }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; background: none; color: var(--blue); cursor: pointer; padding: 0; }
.page { max-width: 1240px; margin: 0 auto; padding: 38px 22px 70px; }
.hero-row, .browser-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
h1 { margin: 3px 0 7px; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.045em; line-height: 1.05; }
h2, h3 { margin-top: 0; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; margin: 0 0 7px; }
.muted, .hint { color: var(--muted); margin: 0; }
.hint { font-size: 13px; line-height: 1.5; }
.hero-actions, .browser-actions, .actions-cell { display: flex; align-items: center; gap: 10px; }
.button, button.primary, button.secondary, button.danger { border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.primary { background: var(--blue); color: white; }
.primary:hover { background: var(--blue-dark); }
.secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.danger { background: #fff0f2; color: var(--red); }
.wide { width: 100%; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: visible; margin-bottom: 22px; }
.toolbar { padding: 16px; display: flex; align-items: flex-end; gap: 14px; border-bottom: 1px solid var(--line); }
.search-box { display: grid; gap: 6px; flex: 1; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #cdd7e5; border-radius: 9px; background: white; color: var(--ink); padding: 10px 11px; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,102,217,.12); }
.count-chip { background: #eef2f7; color: var(--muted); border-radius: 999px; padding: 8px 12px; font-size: 13px; white-space: nowrap; }
.table-wrap { max-height: 57vh; overflow: auto; border-radius: 0 0 16px 16px; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; z-index: 2; background: #f8fafc; color: #5e6c81; font-size: 12px; letter-spacing: .04em; text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
td { padding: 13px 16px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { width: 72px; text-align: center; color: var(--muted); }
.email-cell { font-weight: 650; }
.totp-code { border: 0; background: #eaf4ff; color: #0756b0; font: 800 17px ui-monospace, SFMono-Regular, Consolas, monospace; border-radius: 8px; padding: 7px 12px; letter-spacing: .08em; cursor: pointer; min-width: 94px; }
.actions-cell { justify-content: flex-start; white-space: nowrap; }
.actions-cell form { margin: 0; }
.login-action { color: var(--blue); background: transparent; border: 0; cursor: pointer; font-weight: 750; padding: 6px; }
.danger-link { color: var(--red); background: transparent; border: 0; cursor: pointer; padding: 6px; }
.empty-row td { text-align: center !important; padding: 56px 20px; color: var(--muted); }
.popover { position: relative; }
.popover summary { list-style: none; cursor: pointer; }
.popover summary::-webkit-details-marker { display: none; }
.popover-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; width: min(360px, calc(100vw - 32px)); background: white; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(24, 43, 72, .18); border-radius: 14px; padding: 18px; }
.stack-form { display: grid; gap: 13px; }
.stack-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.notice { padding: 12px 15px; border-radius: 10px; margin-bottom: 18px; }
.notice.success { color: var(--green); background: #e8f8f1; border: 1px solid #bde9d7; }
.notice.error { color: var(--red); background: #fff0f2; border: 1px solid #f5c7d0; }
.jobs-panel { padding: 18px; }
.panel-title h2 { font-size: 17px; margin-bottom: 12px; }
.job-list { display: grid; gap: 8px; }
.job-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 9px; padding: 10px 12px; color: var(--ink); background: #f7f9fc; }
.status { font-size: 12px; padding: 5px 9px; border-radius: 999px; background: #edf1f5; color: var(--muted); }
.status-running { background: #e6f7ef; color: var(--green); }
.status-queued { background: #fff6dc; color: #8a6400; }
.status-failed { background: #fff0f2; color: var(--red); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); background: white; border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 20px; padding: 34px; }
.login-card h1 { font-size: 31px; margin-top: 16px; }
.login-card > p { color: var(--muted); margin: 0 0 24px; }
.logo-mark { width: 48px; height: 48px; display: grid; place-items: center; color: white; background: linear-gradient(135deg, #0878ee, #063e9b); border-radius: 13px; font-weight: 900; }
.browser-page { max-width: 1500px; }
.browser-header { align-items: center; }
.browser-header h1 { font-size: 30px; }
.remote-shell { position: relative; height: calc(100vh - 200px); min-height: 580px; background: #101722; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.remote-placeholder { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; color: white; padding: 30px; }
.remote-placeholder[hidden], .remote-frame[hidden] { display: none !important; }
.remote-placeholder p { color: #9fb0c6; }
.spinner { width: 32px; height: 32px; border: 3px solid #35506f; border-top-color: #4b9fff; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
.remote-frame, .remote-frame iframe { width: 100%; height: 100%; border: 0; background: #111; }
.inline-details summary { color: var(--blue); cursor: pointer; }
.mini-form { display: flex; gap: 6px; margin-top: 8px; }
.mini-form input { width: 150px; padding: 7px; }
.mini-form button { border: 0; border-radius: 7px; background: var(--blue); color: white; padding: 7px 10px; }
@media (max-width: 760px) {
  .page { padding: 24px 12px 50px; }
  .topbar { padding: 0 14px; }
  .hero-row, .browser-header { align-items: stretch; flex-direction: column; }
  .hero-actions, .browser-actions { flex-wrap: wrap; }
  .panel { border-radius: 12px; }
  td, th { padding: 11px 10px; }
  th:first-child, td:first-child { width: 45px; }
  .email-cell { min-width: 220px; }
  .actions-cell { min-width: 150px; }
  .remote-shell { min-height: 500px; height: 70vh; }
}
