/* ===========================================================
   小雫面板 ShizukuPanel · 样式表
   深色樱花粉主题 · 无任何外部依赖
   =========================================================== */

:root {
  --bg: #14141a;
  --bg-soft: #191921;
  --card: #1d1d26;
  --card-2: #23232e;
  --card-3: #292935;
  --border: #2b2b38;
  --border-soft: #24242f;

  --pink: #f5a9c0;
  --pink-soft: #ffc8db;
  --pink-deep: #d4809c;
  --pink-ink: #2a1620;

  --amber: #f0b429;
  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;
  --gray: #6b6b7d;

  --text: #eeeeee;
  --text-dim: #b6b6c4;
  --muted: #8d8da0;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .38);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 10% -12%, rgba(245, 169, 192, .10), transparent 62%),
    radial-gradient(760px 420px at 102% -6%, rgba(240, 180, 41, .055), transparent 58%);
}

[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: .2px; }
p { margin: 0; }

a { color: var(--pink); text-decoration: none; }
a:hover { color: var(--pink-soft); text-decoration: underline; }

code, .mono { font-family: var(--mono); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #32323f; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3d3d4d; }

/* ===================== 通用控件 ===================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, transform .1s;
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--card-3); border-color: #3a3a4a; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--pink-ink);
  font-weight: 600;
}
.btn-primary:hover { background: var(--pink-soft); border-color: var(--pink-soft); }

.btn-amber { background: var(--amber); border-color: var(--amber); color: #2a2000; font-weight: 600; }
.btn-amber:hover { background: #ffc63f; border-color: #ffc63f; }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { background: var(--card-2); color: var(--text); }

.btn-danger { background: transparent; border-color: #5c2f35; color: var(--red); }
.btn-danger:hover { background: rgba(248, 113, 113, .12); border-color: var(--red); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

.btn.is-loading { pointer-events: none; opacity: .78; }
.btn.is-loading::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin .7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card {
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-blue { background: rgba(96, 165, 250, .14); color: #9cc6fb; border-color: rgba(96, 165, 250, .3); }
.badge-gray { background: rgba(148, 148, 170, .13); color: #a6a6ba; border-color: rgba(148, 148, 170, .26); }
.badge-green { background: rgba(74, 222, 128, .13); color: #86efac; border-color: rgba(74, 222, 128, .28); }
.badge-amber { background: rgba(240, 180, 41, .14); color: #f6cd6a; border-color: rgba(240, 180, 41, .3); }
.badge-red { background: rgba(248, 113, 113, .14); color: #fca5a5; border-color: rgba(248, 113, 113, .3); }
.badge-pink { background: rgba(245, 169, 192, .14); color: var(--pink-soft); border-color: rgba(245, 169, 192, .3); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--gray);
  box-shadow: 0 0 0 3px rgba(148, 148, 170, .1);
}
.dot-active { background: var(--green); box-shadow: 0 0 0 3px rgba(74, 222, 128, .14); }
.dot-failed { background: var(--red); box-shadow: 0 0 0 3px rgba(248, 113, 113, .14); }
.dot-inactive { background: var(--gray); }

/* 进度条 */
.bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: #262632;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  background: linear-gradient(90deg, var(--pink-deep), var(--pink));
  transition: width .5s ease, background .3s;
}
.bar-fill.warn { background: linear-gradient(90deg, #c98f16, var(--amber)); }
.bar-fill.danger { background: linear-gradient(90deg, #c04545, var(--red)); }

/* 骨架屏 */
.sk {
  background: linear-gradient(90deg, #23232e 25%, #2e2e3b 37%, #23232e 63%);
  background-size: 400% 100%;
  animation: sk 1.35s ease infinite;
  border-radius: 6px;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.sk-line { height: 12px; }
.sk-big { height: 30px; }

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(245, 169, 192, .25);
  border-top-color: var(--pink);
  animation: spin .8s linear infinite;
}

/* ===================== 登录页 ===================== */

.login-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 28px 28px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: rise .35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.login-logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--pink);
  background: radial-gradient(circle at 50% 35%, rgba(245, 169, 192, .2), rgba(245, 169, 192, .05));
  border: 1px solid rgba(245, 169, 192, .28);
}
.login-logo svg { width: 42px; height: 42px; }

.login-card h1 { font-size: 22px; letter-spacing: 1px; }
.login-sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; text-align: left; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--muted); }

input[type="text"], input[type="password"], input[type="email"], select, textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 10px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(245, 169, 192, .13);
  background: #17171f;
}
input::placeholder, textarea::placeholder { color: #5f5f70; }
input.invalid, textarea.invalid { border-color: var(--red); }
select { appearance: none; cursor: pointer; background-image: none; }

.form-error {
  background: rgba(248, 113, 113, .1);
  border: 1px solid rgba(248, 113, 113, .3);
  color: #fca5a5;
  font-size: 12.5px;
  padding: 9px 11px;
  border-radius: 9px;
  line-height: 1.5;
  word-break: break-word;
}
.form-hint-line { font-size: 11.5px; color: var(--muted); }

/* ===================== 主框架 ===================== */

.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  background: #17171f;
  border-right: 1px solid var(--border-soft);
  padding: 18px 14px;
  gap: 18px;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.brand-paw { width: 30px; height: 30px; color: var(--pink); flex: none; }
.brand-paw svg { width: 100%; height: 100%; display: block; }
.brand-name { font-size: 15.5px; font-weight: 600; letter-spacing: .6px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: background .16s, color .16s;
}
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(245, 169, 192, .16), rgba(245, 169, 192, .04));
  color: var(--pink-soft);
  border-color: rgba(245, 169, 192, .22);
  font-weight: 600;
}
.nav-icon { width: 18px; text-align: center; font-size: 15px; line-height: 1; }

.sidebar-foot { display: flex; flex-direction: column; gap: 9px; }
.panel-version {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  font-family: var(--mono);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border-soft);
}

.content { flex: 1; min-width: 0; margin-left: 200px; padding: 24px 26px 44px; }

.page { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 19px; }
.page-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.head-count { color: var(--pink); font-family: var(--mono); }

.section-title {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 22px 0 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }

/* ===================== 概览 ===================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
}

.stat-card { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 11px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-icon { font-size: 14px; line-height: 1; }
.stat-value { font-size: 27px; font-weight: 600; line-height: 1.1; letter-spacing: .5px; }
.stat-value small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stat-sub { font-size: 11.5px; color: var(--muted); font-family: var(--mono); word-break: break-all; }

.hostinfo { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 18px; }
.hostinfo-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hostinfo-item .k { font-size: 11.5px; color: var(--muted); }
.hostinfo-item .v { font-size: 13.5px; font-family: var(--mono); word-break: break-all; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 14px; }
.service-card { display: flex; flex-direction: column; gap: 12px; }
.service-top { display: flex; align-items: center; gap: 9px; }
.service-name { font-size: 14.5px; font-weight: 600; flex: 1; }
.service-meta { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.service-actions { display: flex; gap: 8px; }
.service-actions .btn { flex: 1; }

/* ===================== 网站 ===================== */

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.site-card { display: flex; flex-direction: column; gap: 12px; transition: border-color .18s, transform .18s; }
.site-card:hover { border-color: #35354a; }
.site-card.is-off { opacity: .74; }
.site-card.is-busy { border-color: rgba(245, 169, 192, .35); }

.site-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.site-name { font-size: 16.5px; font-weight: 600; letter-spacing: .3px; word-break: break-all; }
.site-head .spacer { flex: 1; }

.site-block { display: flex; flex-direction: column; gap: 5px; }
.site-block .k { font-size: 11.5px; color: var(--muted); }
.domain-list { display: flex; flex-wrap: wrap; gap: 6px; }
.domain-list a {
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(245, 169, 192, .08);
  border: 1px solid rgba(245, 169, 192, .2);
  border-radius: 7px;
  padding: 3px 8px;
  text-decoration: none;
  word-break: break-all;
}
.domain-list a:hover { background: rgba(245, 169, 192, .17); text-decoration: none; }

.path-btn {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color .16s, color .16s;
  word-break: break-all;
}
.path-btn:hover { border-color: var(--pink-deep); color: var(--pink-soft); }

.site-foot {
  display: flex;
  gap: 7px;
  border-top: 1px solid var(--border-soft);
  padding-top: 12px;
  margin-top: auto;
  flex-wrap: wrap;
}
.site-foot .btn { flex: 1; min-width: 72px; }

/* 开关 */
.switch {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #303040;
  cursor: pointer;
  padding: 0;
  flex: none;
  transition: background .2s, border-color .2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #8e8ea4;
  transition: transform .2s, background .2s;
}
.switch.on { background: rgba(74, 222, 128, .22); border-color: rgba(74, 222, 128, .45); }
.switch.on::after { transform: translateX(19px); background: var(--green); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* ===================== 证书 ===================== */

.cert-summary { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: center; }
.cert-summary-item { display: flex; flex-direction: column; gap: 3px; }
.cert-summary-item .k { font-size: 11.5px; color: var(--muted); }
.cert-summary-item .v { font-size: 13.5px; font-family: var(--mono); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
thead th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 12px 14px;
  background: #1a1a23;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #20202a; }
td.mono, .td-mono { font-family: var(--mono); font-size: 12.5px; }
.days-danger { color: var(--red); font-weight: 600; }
.days-warn { color: var(--amber); font-weight: 600; }
.days-ok { color: var(--text-dim); }

.empty-state {
  text-align: center;
  padding: 52px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(29, 29, 38, .5);
}
.empty-emoji { font-size: 40px; line-height: 1; }
.empty-title { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--text); }
.empty-desc { margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.empty-state.small { padding: 30px 18px; }

.cert-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.65;
}

/* ===================== 设置 ===================== */

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}
.info-row:last-child { border-bottom: none; }
.info-row .k { font-size: 12.5px; color: var(--muted); }
.info-row .v { font-family: var(--mono); font-size: 12.5px; word-break: break-all; text-align: right; }
.form-stack { display: flex; flex-direction: column; gap: 13px; margin-top: 14px; }

.about-box { text-align: center; padding: 22px 16px; }
.about-box .about-emoji { font-size: 30px; }
.about-box .about-title { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--pink-soft); }
.about-box .about-desc { margin-top: 7px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* ===================== 弹窗 ===================== */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(9, 9, 13, .68);
  animation: fade .16s ease;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: rise .22s ease;
  overflow: hidden;
}
.modal.modal-wide { max-width: 580px; }
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}
.modal-head h3 { font-size: 15.5px; flex: 1; }
.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 7px;
}
.modal-close:hover { background: var(--card-2); color: var(--text); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
  background: #1a1a23;
  flex: none;
}

.alert-icon { font-size: 20px; line-height: 1; }
.alert-text { font-size: 13.5px; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.alert-hint {
  margin-top: 11px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #f6cd6a;
  background: rgba(240, 180, 41, .1);
  border: 1px solid rgba(240, 180, 41, .28);
  border-radius: 10px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 新建网站表单 */
.type-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.type-option {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color .16s, background .16s, transform .1s;
  font: inherit;
  color: var(--text-dim);
}
.type-option:hover { background: var(--card-2); transform: translateY(-1px); }
.type-option .t-emoji { display: block; font-size: 21px; margin-bottom: 6px; }
.type-option .t-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.type-option .t-desc { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.type-option.is-active {
  border-color: var(--pink);
  background: rgba(245, 169, 192, .1);
  color: var(--pink-soft);
}
.type-option.is-active .t-name { color: var(--pink-soft); }

.check-row { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
  cursor: pointer;
  flex: none;
}
.check-row span { font-size: 13px; color: var(--text-dim); }

.db-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--border-soft);
  border-left: 2px solid rgba(245, 169, 192, .4);
  border-radius: 10px;
  background: rgba(20, 20, 26, .6);
}
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; min-width: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 169, 192, .1);
  border: 1px solid rgba(245, 169, 192, .24);
  color: var(--pink-soft);
  word-break: break-all;
}
.chip.invalid { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); color: #fca5a5; }
.chip-empty { font-size: 11.5px; color: var(--muted); }

/* ===================== Toast ===================== */

.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 210px;
  max-width: 100%;
  background: #22222c;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gray);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: var(--shadow);
  animation: toastIn .22s ease;
  word-break: break-word;
}
.toast.out { animation: toastOut .22s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(18px); } }
.toast-icon { flex: none; font-size: 14px; line-height: 1.4; }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-warn { border-left-color: var(--amber); }
.toast-info { border-left-color: var(--pink); }

/* ===================== 响应式 ===================== */

@media (max-width: 900px) {
  .app { flex-direction: column; }

  .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
    overflow-x: auto;
    z-index: 30;
    backdrop-filter: blur(8px);
    background: rgba(23, 23, 31, .96);
  }

  .brand { padding: 0; flex: none; }
  .brand-name { font-size: 14.5px; }

  .nav { flex-direction: row; flex: 1; gap: 6px; }
  .nav-item { padding: 7px 12px; white-space: nowrap; width: auto; }
  .nav-item.is-active { background: rgba(245, 169, 192, .15); }
  .nav-icon { font-size: 14px; }

  .sidebar-foot { flex-direction: row; align-items: center; gap: 8px; flex: none; }
  .panel-version { border-bottom: none; border-left: 1px solid var(--border-soft); padding: 0 0 0 10px; }
  .sidebar-foot .btn { padding: 5px 10px; font-size: 12px; }

  .content { margin-left: 0; padding: 16px 14px 40px; }

  .type-picker { grid-template-columns: 1fr; }
  .modal { max-height: 94vh; }
  .login-card { padding: 28px 22px 24px; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 21px; }
  .stat-sub { font-size: 10.5px; }
  .site-grid { grid-template-columns: 1fr; }
  .toast-wrap { right: 12px; left: 12px; bottom: 12px; align-items: stretch; max-width: none; }
  .page-head { align-items: stretch; }
  .page-head .btn { width: 100%; }
}

/* ===================== 文件 ===================== */

#page-files { position: relative; }

.files-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.6;
  color: #f6cd6a;
  background: rgba(240, 180, 41, .09);
  border: 1px solid rgba(240, 180, 41, .26);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  margin-bottom: 14px;
  word-break: break-word;
}
.files-note code { color: var(--pink-soft); font-size: 11.5px; }

.files-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 12px;
  margin-bottom: 12px;
}

.files-crumbs {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-height: 34px;
}
.crumb {
  border: none;
  background: transparent;
  font: inherit;
  color: var(--text-dim);
  padding: 1px 4px;
  border-radius: 6px;
  cursor: pointer;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
  transition: background .16s, color .16s;
}
.crumb:hover { background: var(--card-2); color: var(--pink-soft); }
.crumb-current { color: var(--pink-soft); font-weight: 600; padding: 1px 4px; }
.crumb-sep { color: var(--muted); opacity: .7; }

.files-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.files-actions-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.files-sel-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pink-soft);
  padding: 0 2px;
  white-space: nowrap;
}

/* ---- 拖拽上传提示 ---- */

.files-drop {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(20, 20, 26, .84);
  border: 2px dashed var(--pink);
  border-radius: var(--radius);
}
#page-files.is-drag .files-drop { display: flex; }
.files-drop-card { text-align: center; }
.files-drop-emoji { font-size: 46px; line-height: 1; }
.files-drop-title { margin-top: 10px; font-size: 17px; font-weight: 600; color: var(--pink-soft); }
.files-drop-desc { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* ---- 上传进度 ---- */

.files-upload {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.files-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
  word-break: break-all;
}

/* ---- 文件列表 ---- */

.files-table-wrap { transition: opacity .16s; }
.files-table-wrap.is-busy { opacity: .55; }

.file-table { min-width: 780px; }
.file-table .col-check { width: 44px; text-align: center; }
.file-table .col-size { width: 92px; text-align: right; }
.file-table .col-time { width: 152px; }
.file-table .col-mode { width: 76px; }
.file-table .col-ops { width: 1%; white-space: nowrap; }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text); }
.sortable.is-sorted { color: var(--pink-soft); }
.sort-arrow { margin-left: 5px; font-size: 10px; opacity: .85; }

.file-check {
  width: 15px;
  height: 15px;
  accent-color: var(--pink);
  cursor: pointer;
  vertical-align: middle;
  margin: 0;
}

.file-row.is-selected { background: rgba(245, 169, 192, .07); }
.file-row.is-selected:hover { background: rgba(245, 169, 192, .11); }

.file-icon {
  display: inline-block;
  width: 20px;
  margin-right: 7px;
  text-align: center;
  font-size: 14px;
}
.file-name { word-break: break-all; }
.file-open {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  text-align: left;
  word-break: break-all;
}
.file-open:hover { color: var(--pink-soft); text-decoration: underline; }
.file-badge { margin-left: 8px; vertical-align: middle; }

.file-ops {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity .16s;
}
.file-row:hover .file-ops,
.file-row:focus-within .file-ops,
.file-row.is-selected .file-ops { opacity: 1; }

.file-op { padding: 4px 7px; font-size: 12px; gap: 4px; }
.file-op .op-emoji { font-size: 12.5px; line-height: 1; }
.file-op .op-label { font-size: 12px; }

/* ---- 骨架 / 空态 ---- */

.files-sk { display: flex; flex-direction: column; padding: 4px 16px; }
.files-sk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
}
.files-sk-row:last-child { border-bottom: none; }

.files-empty-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.files-empty-note { margin-top: 16px; font-size: 11.5px; color: var(--muted); }

/* ---- 编辑器 / 预览弹窗 ---- */

.modal.modal-editor { max-width: min(1100px, 96vw); }
.modal.modal-preview { max-width: min(960px, 96vw); }

.editor-meta,
.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.file-title {
  font-family: var(--mono);
  color: var(--text);
  word-break: break-all;
}

.editor-area {
  width: 100%;
  height: 70vh;
  min-height: 240px;
  resize: none;
  font-size: 12.5px;
  line-height: 1.62;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}
.editor-tip { margin-top: 8px; font-size: 11.5px; color: var(--muted); }

.preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  max-height: 62vh;
  overflow: auto;
}
.preview-box img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  border-radius: 6px;
}

/* ---- 文件页响应式 ---- */

@media (hover: none) {
  .file-ops { opacity: 1; }
}

@media (max-width: 1100px) {
  .file-op .op-label { display: none; }
  .file-op { padding: 5px 7px; }
}

@media (max-width: 900px) {
  .files-crumbs { flex: 1 1 100%; }
  .files-actions { width: 100%; }
  .files-actions-group { width: 100%; }
  .files-actions .btn { flex: 1; min-width: 84px; }
  .file-ops { opacity: 1; }
  .file-row .col-ops { padding-left: 6px; padding-right: 6px; }
}

@media (max-width: 560px) {
  .files-actions .btn { font-size: 12px; padding: 6px 8px; }
  .crumb { font-size: 11.5px; }
  .editor-area { height: 58vh; }
  .preview-box img { max-height: 50vh; }
}
