/* assets/style.css — 域名跳转系统后台样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg:      #0e1116;
  --panel:   #171c25;
  --panel-2: #1e2530;
  --text:    #e9edf4;
  --muted:   #98a2b3;
  --border:  #28303d;
  --primary: #4f8cff;
  --ok:      #22c55e;
  --ok-bg:   rgba(34, 197, 94, .12);
  --err:     #f04438;
  --err-bg:  rgba(240, 68, 56, .12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1a2333 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  padding: 24px 16px 48px;
}

.wrap { max-width: 960px; margin: 0 auto; }

.page-title { font-size: 20px; font-weight: 700; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-actions { display: flex; gap: 8px; align-items: center; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px; font-weight: 600;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field label.inline { display: flex; align-items: center; gap: 8px; color: var(--text); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input:not([type=hidden]),
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input[type=checkbox] { width: auto; accent-color: var(--primary); }

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease, border-color .15s ease;
}
.btn:hover { filter: brightness(1.15); border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn-del {
  border: 1px solid rgba(240, 68, 56, .4);
  background: var(--err-bg);
  color: var(--err);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.btn-del:hover { filter: brightness(1.2); }

.flash { padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.flash.ok    { background: var(--ok-bg);  border: 1px solid rgba(34, 197, 94, .3); color: #6ee7a0; }
.flash.error { background: var(--err-bg); border: 1px solid rgba(240, 68, 56, .3); color: #ff9b94; }

.hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* 汇总 */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.sum-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.sum-item span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.sum-item b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* 工具栏 */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }.toolbar input { flex: 1; min-width: 160px; }
.toolbar select { width: auto; }

/* 表格 */
.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stat-table th, .stat-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.stat-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.stat-table td.num, .stat-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.stat-table tbody tr:last-child td { border-bottom: none; }
.stat-table td.target { color: var(--muted); word-break: break-all; }

.tag {
  display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.tag.on { color: #6ee7a0; border-color: rgba(34, 197, 94, .4); background: var(--ok-bg); }
.tag.miss { color: #ff9b94; border-color: rgba(240, 68, 56, .4); background: var(--err-bg); }
.stat-table .thumb { cursor: zoom-in; }

/* 图片大图查看 */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, .82);
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}

.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-btns { display: flex; gap: 8px; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 公开跳转 / 图片页 */
.wrap.narrow { max-width: 480px; }
.redirect-page { text-align: center; }
.redirect-img { display: block; margin: 0 auto 16px; max-width: 100%; }
.redirect-img img { max-width: 100%; height: auto; border-radius: 12px; }
.redirect-tip { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
.redirect-tip b { color: var(--text); font-size: 18px; }

/* 列表辅助 */
.table-wrap { overflow-x: auto; }
.thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); vertical-align: middle; margin-top: 4px; }
.thumb.lg { width: 96px; height: auto; max-height: 120px; display: block; }
.tag.img { color: #6ee7a0; border-color: rgba(34, 197, 94, .4); background: var(--ok-bg); }
.tag.lnk { color: #6ea8ff; border-color: rgba(79, 140, 255, .4); background: rgba(79, 140, 255, .1); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.nowrap { white-space: nowrap; }

/* 状态开关 */
.switch-form { margin: 0; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 999px; transition: .2s;
}
.switch .slider:before {
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(18px); }

/* 弹窗 */
.modal { display: none; position: fixed; inset: 0; z-index: 50; }
.modal.open { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.modal-box {
  position: relative; max-width: 600px; margin: 5vh auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px; max-height: 90vh; overflow: auto;
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head span { font-size: 15px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

@media (max-width: 680px) {
  .field-row { grid-template-columns: 1fr; }
  .summary { grid-template-columns: repeat(2, 1fr); }
}

/* 批量创建 子选择夹 */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-family: inherit;
  padding: 8px 4px;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 目标地址 行内编辑 */
.cell-edit { cursor: pointer; border-radius: 6px; transition: background .12s ease; }
.cell-edit:hover { background: var(--panel-2); }
.inline-input {
  width: 100%;
  min-width: 140px;
  background: var(--bg);
  border: 1px solid var(--primary);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
}

/* 行操作下拉菜单 */
.row-menu {
  position: fixed;
  z-index: 80;
  min-width: 120px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.rm-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.rm-item:hover { background: var(--bg); }
.rm-item.rm-danger { color: var(--err); }
.rm-item.rm-danger:hover { background: var(--err-bg); }
