/* 静态网站托管平台 - 管理前端样式 */
:root {
  --bg: #f5f6fa;
  --panel: #ffffff;
  --text: #1f2330;
  --muted: #7a8095;
  --border: #e4e7ef;
  --accent: #4f6ef7;
  --accent-dark: #3d56d6;
  --danger: #e5484d;
  --ok: #2f9e6e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(20, 24, 40, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.loading { text-align: center; color: var(--muted); padding: 80px 0; }
.muted { color: var(--muted); font-size: 13px; }

/* ---- 顶栏 ---- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px; background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 17px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel); color: var(--text);
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  text-decoration: none; user-select: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: #fdf1f1; color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.tiny { padding: 3px 8px; font-size: 12px; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { border-color: var(--border); }

/* ---- 布局 ---- */
.container { max-width: 1000px; margin: 24px auto; padding: 0 20px; }
.empty {
  background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 60px 20px; text-align: center; color: var(--muted);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow);
}
.card-title { font-size: 16px; font-weight: 600; }
.card-url { font-size: 13px; word-break: break-all; }
.card-meta { color: var(--muted); font-size: 12px; }
.card-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ---- 面板 ---- */
.panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.panel h2 { font-size: 15px; margin: 0 0 12px; }
.upload-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.detail-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.detail-head .site-name { font-size: 17px; font-weight: 700; }
.site-url {
  background: #f0f3ff; border: 1px solid #dbe3ff; color: var(--accent-dark);
  padding: 4px 10px; border-radius: 6px; font-size: 13px; word-break: break-all;
}

/* ---- 表格 ---- */
table.files { width: 100%; border-collapse: collapse; }
table.files th, table.files td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px;
}
table.files th { color: var(--muted); font-weight: 500; background: #fafbfe; }
table.files td.fpath { font-family: Consolas, "Courier New", monospace; word-break: break-all; }
table.files tr:hover td { background: #f8f9fd; }
.row-actions { white-space: nowrap; text-align: right; }

/* ---- 弹窗 ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 24, 40, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal {
  background: var(--panel); border-radius: 12px; padding: 24px;
  width: 100%; max-width: 420px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.modal .form-row { margin-bottom: 14px; }
.modal label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---- 表单 ---- */
input[type="text"], input[type="password"], textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; transition: border 0.15s;
}
input:focus, textarea:focus { border-color: var(--accent); }

/* ---- 登录页 ---- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef1fb 0%, #f7f8fc 100%);
}
.login-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 36px 32px; width: 100%; max-width: 360px; box-shadow: 0 8px 30px rgba(30, 40, 90, 0.08);
  text-align: center;
}
.login-box h1 { font-size: 20px; margin: 0 0 6px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-box input { margin-bottom: 14px; text-align: center; }
.login-box .btn { width: 100%; justify-content: center; padding: 10px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ---- 编辑器 ---- */
.editor-backdrop {
  position: fixed; inset: 0; background: rgba(20, 24, 40, 0.5); z-index: 200;
  display: flex; align-items: stretch; justify-content: center; padding: 24px;
}
.editor-box {
  background: var(--panel); border-radius: 12px; width: 100%; max-width: 960px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.editor-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
}
.editor-head .file-name { font-family: Consolas, monospace; font-size: 13px; word-break: break-all; }
.editor-box textarea {
  flex: 1; resize: none; border: none; border-radius: 0;
  font-family: Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.6; padding: 16px;
}
.editor-box textarea:focus { border: none; }

@media (max-width: 600px) {
  .container { margin: 16px auto; padding: 0 12px; }
  .topbar { padding: 12px 14px; }
  table.files th:nth-child(2), table.files td:nth-child(2),
  table.files th:nth-child(3), table.files td:nth-child(3) { display: none; }
}
