/* ============================================================
 * emobaby.cn - 主站样式（深色主题）
 * 结构参照 D:/ai/web/css/style.css
 * 页面：index.html（首页：工作记录 + 项目入口） / publish.html（发布页）
 * ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-0: #0a0d14;
  --bg-1: #0e1220;
  --surface: #121725;
  --surface-2: #171e30;
  --border: #242e49;
  --border-soft: #1a2138;
  --text: #e8ebf4;
  --text-dim: #98a1b8;
  --text-faint: #5e6880;
  --accent: #6ee7ff;
  --accent-2: #a78bfa;
  --accent-dim: rgba(110, 231, 255, 0.12);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, 0.12);
  --ok: #6ee7a8;
  --ok-dim: rgba(110, 231, 168, 0.12);
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: '幼圆', 'YouYuan', '华文圆体', 'STYuanti', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  background: var(--bg-0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 20% 0%, rgba(110, 231, 255, 0.06), transparent 70%),
    radial-gradient(640px 420px at 90% 100%, rgba(167, 139, 250, 0.05), transparent 70%);
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.8; }

.mono-label {
  font-family: 'Consolas', 'SF Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- 右上角入口按钮 ---------- */
.entry-link {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 10;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
  background: rgba(18, 23, 37, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.entry-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  opacity: 1;
  transform: translateY(-1px);
}

/* ---------- 页面框架 ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 70px 6% 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.block-title { text-align: center; margin-bottom: 52px; }

.block-title h1 {
  font-family: 'Consolas', 'SF Mono', Menlo, '幼圆', 'YouYuan', 'Microsoft YaHei', sans-serif;
  font-size: clamp(40px, 9vw, 96px);
  font-weight: 700;
  letter-spacing: 6px;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--accent) 0%, #9ff1ff 45%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 28px rgba(110, 231, 255, 0.28));
}

.block-title h1 .dot {
  -webkit-text-fill-color: var(--accent);
  filter: drop-shadow(0 0 14px rgba(110, 231, 255, 0.8));
}

.block-title .title-sub {
  margin-top: 14px;
  font-family: 'Consolas', 'SF Mono', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 6px;
  color: var(--text-faint);
  text-transform: uppercase;
}
.block-title .title-sub::before,
.block-title .title-sub::after {
  content: '';
  display: inline-block;
  width: 34px;
  height: 1px;
  vertical-align: middle;
  margin: 0 14px;
  background: linear-gradient(90deg, transparent, var(--border));
}
.block-title .title-sub::after {
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ---------- 分区 ---------- */
.section {
  width: 100%;
  max-width: 960px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 26px 28px;
}

.section + .section { margin-top: 28px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.section-head h2 { font-size: 17px; color: var(--text); font-weight: 600; }
.section-head .updated { font-size: 12px; color: var(--text-faint); }

/* ---------- 工作记录列表 ---------- */
.record-list { display: flex; flex-direction: column; }

.record-item {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border-soft);
}
.record-item:last-child { border-bottom: none; }

.record-date {
  font-family: 'Consolas', 'SF Mono', Menlo, monospace;
  font-size: 13px;
  color: var(--accent);
  padding-top: 1px;
}

.record-body { min-width: 0; }
.record-title { font-size: 15px; color: var(--text); font-weight: 600; overflow-wrap: break-word; }
.record-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.record-empty {
  font-size: 14px;
  color: var(--text-faint);
  padding: 10px 0;
}

/* ---------- 两栏项目入口 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  display: block;
  padding: 24px 22px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s ease, transform 0.2s ease;
  color: inherit;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  opacity: 1;
}

.p-label {
  display: block;
  font-family: 'Consolas', 'SF Mono', Menlo, monospace;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.project-card h3 {
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--accent);
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: break-word;
}
.project-card .p-desc {
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-dim);
  margin-top: 10px;
  white-space: pre-line;
  overflow-wrap: break-word;
}
.project-card .p-host {
  display: inline-block;
  margin-top: 16px;
  font-family: 'Consolas', 'SF Mono', Menlo, monospace;
  font-size: 12px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

/* ---------- 页脚 ---------- */
.site-foot {
  position: relative;
  z-index: 1;
  margin-top: 46px;
  padding: 30px 6% 44px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border-soft);
}
.site-foot a { color: var(--text-faint); }
.site-foot a:hover { color: var(--text); opacity: 1; }

/* ============================================================
 * 发布页
 * ============================================================ */
body.pg-publish { background: var(--bg-0); }

.pub-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 5%;
}
.pub-wrap { width: 100%; max-width: 780px; }

.pub-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.pub-top .logo { font-family: 'Consolas', Menlo, monospace; font-size: 16px; font-weight: 700; }
.pub-top .logo .dot { color: var(--accent); }
.pub-top .who { font-size: 13px; color: var(--text-faint); }

.pub-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 28px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  margin-bottom: 22px;
}
.pub-card h2 {
  font-size: 17px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.login-box { text-align: center; padding: 44px 36px; }
.login-box .lock-icon {
  width: 54px; height: 54px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 22px;
}
.login-box .sub { font-size: 13px; color: var(--text-faint); margin-bottom: 26px; }

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.form-group label .opt {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 12px;
  margin-left: 6px;
}
.form-group input[type='text'],
.form-group input[type='url'],
.form-group input[type='password'],
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group textarea { resize: vertical; min-height: 84px; line-height: 1.7; }

.login-error { font-size: 13px; color: var(--danger); min-height: 20px; margin-bottom: 6px; }

.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  background: var(--surface);
  color: var(--text);
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); opacity: 1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--bg-0); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { color: var(--bg-0); background: #9ff1ff; box-shadow: 0 6px 24px rgba(110, 231, 255, 0.25); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }
.btn-danger:hover { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); opacity: 1; }
.btn-del { padding: 6px 14px; font-size: 12px; background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, 0.35); }

.row-editor { display: flex; flex-direction: column; gap: 16px; }
.row-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  background: var(--bg-1);
}
.row-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.row-item-head .idx {
  font-family: 'Consolas', Menlo, monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--text-faint);
}
.row-item-head .idx b { color: var(--accent); }

.btn-add {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}
.btn-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.status-bar {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999;
  max-width: 420px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  display: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.status-bar.show { display: block; }
.status-bar.ok { background: #10251b; color: var(--ok); border: 1px solid rgba(110, 231, 168, 0.35); }
.status-bar.err { background: #2a1416; color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.4); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .page { padding: 46px 5% 30px; }
  .block-title { margin-bottom: 34px; }
  .section { padding: 22px 20px; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .record-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pub-card { padding: 22px 20px; }
}
