:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e3e6ec;
  --line-strong: #cfd5df;
  --text: #1a1d23;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff4ff;
  --ok: #0f8a5f;
  --ok-soft: #e9f8f1;
  --err: #cf2f2f;
  --err-soft: #fdeeee;
  --warn: #a86200;
  --warn-soft: #fff6e6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 19px; }
h2 { font-size: 21px; }
h3 { font-size: 15px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* ---------------- 登录 ---------------- */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 420px at 50% -10%, #e8efff 0%, transparent 70%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 26px 24px;
  box-shadow: var(--shadow);
}

.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.brand p { margin: 2px 0 0; font-size: 12.5px; }
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  flex: none;
}
.brand-mark.sm { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.14); }

/* ---------------- 表单 ---------------- */
label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 550;
  color: #333944;
}

input[type=text], input[type=password], input:not([type]), select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 11px;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.hint { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; color: var(--muted); }

.check {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-weight: 400;
  font-size: 13px;
  color: #3a4150;
  margin: 4px 0 0;
  cursor: pointer;
}
.check input { margin: 3px 0 0; flex: none; accent-color: var(--primary); }

/* ---------------- 按钮 ---------------- */
.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 550;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: #f7f8fa; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: #f1f3f6; }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; margin-top: 6px; padding: 10px; }
.btn.danger { color: var(--err); border-color: #f0c9c9; }
.btn.danger:hover { background: var(--err-soft); }

.linkbtn {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; color: var(--primary); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--primary-dark); }

/* ---------------- 布局 ---------------- */
.app { display: grid; grid-template-columns: 208px 1fr; min-height: 100%; }

.side {
  background: #101725;
  color: #c9d1de;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 0 8px 16px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .2px;
}
.side nav { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: block;
  padding: 9px 11px;
  border-radius: 7px;
  color: #b7c0cf;
  text-decoration: none;
  font-size: 13.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav.on { background: rgba(37, 99, 235, .9); color: #fff; }
.side-foot { margin-top: auto; padding: 10px 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-foot .muted { color: #8b95a6; }
.side-foot .btn.ghost { color: #c9d1de; border-color: rgba(255,255,255,.18); }
.side-foot .btn.ghost:hover { background: rgba(255,255,255,.08); }

.main { padding: 26px 32px 60px; max-width: 1080px; }

.page-head { margin-bottom: 18px; }
.page-head p { margin: 5px 0 0; font-size: 13px; }
.head-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.check.inline { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card-title { margin-bottom: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid label { margin-bottom: 0; }

.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }

/* ---------------- 拖放区 ---------------- */
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  transition: border-color .15s, background .15s, color .15s;
  cursor: default;
}
.dropzone svg { color: #9aa5b6; margin-bottom: 6px; }
.dropzone.drag {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.dropzone.drag svg { color: var(--primary); }
.dz-title { margin: 4px 0 4px; font-size: 14px; color: #3a4150; }
.dz-title .linkbtn { font-size: 14px; }

.file-list {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  background: #fcfcfd;
}
.file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid #f0f2f5;
}
.file-row:last-child { border-bottom: 0; }
.file-row .p { color: #3a4150; word-break: break-all; }
.file-row .s { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }

/* 二级域名输入 */
.sub-domain { display: flex; align-items: stretch; margin-top: 6px; }
.sub-domain input { margin-top: 0; border-radius: 8px 0 0 8px; border-right: 0; }
.sub-domain .suffix {
  display: flex; align-items: center;
  padding: 0 11px;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  background: #f4f6f9;
  border: 1px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  white-space: nowrap;
}

/* ---------------- 消息 ---------------- */
.msg { margin-top: 12px; font-size: 13px; min-height: 0; }
.msg:empty { display: none; }
.msg.err    { color: var(--err);  background: var(--err-soft);  border: 1px solid #f5d3d3; padding: 9px 12px; border-radius: 8px; white-space: pre-wrap; }
.msg.ok     { color: var(--ok);   background: var(--ok-soft);   border: 1px solid #c6ecd9; padding: 9px 12px; border-radius: 8px; white-space: pre-wrap; }
.msg.warn   { color: var(--warn); background: var(--warn-soft); border: 1px solid #f3e0bc; padding: 9px 12px; border-radius: 8px; white-space: pre-wrap; }

.result {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #c6ecd9;
  background: var(--ok-soft);
  border-radius: 9px;
}
.result .big {
  font-size: 15px;
  font-weight: 600;
  color: var(--ok);
  word-break: break-all;
}
.result .big a { color: var(--ok); }
.result .meta { margin-top: 6px; font-size: 12.5px; color: #46705d; }
.result .open {
  display: inline-block; margin-top: 9px;
  padding: 6px 12px; border-radius: 7px;
  background: #fff; border: 1px solid #c6ecd9;
  color: var(--ok); text-decoration: none; font-size: 13px; font-weight: 550;
}
.result .open:hover { background: #f4fdf8; }

/* ---------------- 列表 ---------------- */
.stack { display: flex; flex-direction: column; gap: 10px; }

.item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; font-size: 14px; }
.item .title a { color: var(--text); text-decoration: none; }
.item .title a:hover { color: var(--primary); }
/* 可点的域名后面挂个 ↗，一眼看出是外链 */
.item .title a::after { content: " ↗"; font-size: 11px; color: #9aa5b6; }

/* 站点卡片里的域名标签也可点 */
a.tag { text-decoration: none; }
a.tag:hover { background: var(--primary-soft); color: var(--primary); }

/* 结果卡里的大链接 */
.result .big a { text-decoration: none; }
.result .big a:hover { text-decoration: underline; }
.item .sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.item .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.item .ops { display: flex; gap: 7px; flex: none; }

.tag {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f1f3f7;
  color: #4a5262;
  white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.no { background: var(--err-soft); color: var(--err); }
.tag.blue { background: var(--primary-soft); color: var(--primary); }

.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: #fbfcfd;
}

/* 记录页：操作人 */
.who {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: #3a4150;
  background: #f1f3f7;
  padding: 1px 8px 1px 6px;
  border-radius: 20px;
  white-space: nowrap;
}
.who::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8b95a6;
}
.who.me { background: var(--primary-soft); color: var(--primary); }
.who.me::before { background: var(--primary); }
.act-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act-detail { margin-top: 4px; font-size: 12.5px; color: var(--muted); word-break: break-all; }

.user-list { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.user-list .row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: 13px;
  border-bottom: 1px solid #f3f5f8;
}
.user-list .row:last-child { border-bottom: 0; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #101725;
  color: #fff;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: 0 8px 28px rgba(16,24,40,.24);
  z-index: 50;
  max-width: 80vw;
}
.toast.err { background: #a71f1f; }
.toast.ok { background: #0d7a53; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    overflow-x: auto;
  }
  .side-brand { padding: 0 4px 0 0; }
  .side nav { flex-direction: row; gap: 4px; }
  .nav { white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; }
  .main { padding: 18px 16px 50px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .item { flex-wrap: wrap; }
}
