/* 瑞幸收藏站 — 咖啡主题配色（深蓝 + 奶咖暖棕） */

:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --ink: #2b2620;
  --muted: #8a8075;
  --brand: #1f3a6b;
  --brand-2: #2e5490;
  --accent: #b07a3a;
  --accent-soft: #f3e3cd;
  --line: #e8e0d2;
  --danger: #b3423a;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(60, 42, 20, 0.08);
  --shadow-lg: 0 12px 40px rgba(60, 42, 20, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  color: var(--brand);
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.3;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--brand);
  white-space: nowrap;
}

.site-header nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
}

.site-header nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: auto;
  text-align: center;
  padding: 28px 20px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

.site-footer a {
  color: var(--muted);
  text-decoration: underline;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  transition: opacity .15s, background .15s, border-color .15s;
}

.btn:hover {
  opacity: .9;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-danger-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: rgba(179, 66, 58, 0.08);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.muted {
  color: var(--muted);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.5;
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-series { background: #e4ebf5; color: var(--brand-2); }
.tag-category { background: var(--accent-soft); color: var(--accent); }
.tag-admin { background: #e4ebf5; color: var(--brand); }
.tag-editor { background: #eae6df; color: var(--muted); }
.tag-self { background: var(--accent-soft); color: var(--accent); }

/* ---------- 主页 ---------- */
.hero {
  text-align: center;
  padding: 72px 24px 40px;
  background:
    radial-gradient(1200px 400px at 50% -80px, rgba(31, 58, 107, 0.10), transparent),
    var(--bg);
}

.hero .hero-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(30px, 6vw, 48px);
  color: var(--brand);
  letter-spacing: 1px;
}

.hero p {
  max-width: 560px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 16px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
  color: var(--ink);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card .card-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.card h2 {
  font-size: 20px;
  color: var(--brand);
}

.card p {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.card .arrow {
  font-weight: 600;
  color: var(--accent);
}

/* ---------- 时间线页 ---------- */
.timeline-page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.page-head {
  margin-bottom: 24px;
}

.page-head h1 {
  font-size: 28px;
  color: var(--brand);
}

.page-sub {
  color: var(--muted);
  margin: 6px 0 0;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-2);
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.chip:hover {
  border-color: var(--brand-2);
}

.chip.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 时间线主体 */
.timeline-year {
  position: relative;
  padding-left: 28px;
  margin-bottom: 24px;
}

.timeline-year::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.year-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.year-dot {
  position: absolute;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.year-head h2 {
  font-size: 20px;
  color: var(--brand);
}

.timeline-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.t-item {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.t-thumb {
  flex: 0 0 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--accent-soft);
}

.t-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.t-body {
  flex: 1;
  min-width: 0;
}

.t-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.t-name {
  font-size: 17px;
}

.t-date {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.t-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.t-notes {
  margin: 8px 0 0;
  color: #5b534a;
  font-size: 14px;
  white-space: pre-wrap;
}

.t-more {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.t-more img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  border: 1px solid var(--line);
}

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

/* ---------- 大图 lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 10, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox[hidden] {
  display: none;
}

.lb-img {
  max-width: 90vw;
  max-height: 82vh;
  border-radius: 10px;
}

.lb-caption {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
}

.lb-nav, .lb-close {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-nav:hover, .lb-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 18px; right: 18px; }

/* ---------- 后台 ---------- */
.admin-main {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.admin-header .user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-name {
  font-size: 14px;
  color: var(--muted);
}

.auth-card {
  max-width: 400px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 22px;
  color: var(--brand);
  margin-bottom: 6px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--ink);
}

.auth-form input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: var(--bg);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--brand-2);
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.admin-tabs button {
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-tabs button:hover {
  color: var(--ink);
}

.admin-tabs button.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tab-head h2 {
  font-size: 18px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.row-thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--accent-soft);
}

.row-thumb-empty {
  display: inline-block;
  border: 1px dashed var(--line);
}

.row-info {
  flex: 1;
  min-width: 0;
}

.row-name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-meta {
  color: var(--muted);
  font-size: 13px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.help-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 10, 0.55);
  z-index: 90;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  margin: auto 0;
}

.modal-sm {
  max-width: 400px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  font-size: 18px;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
}

.modal-body input:focus,
.modal-body textarea:focus,
.modal-body select:focus {
  outline: none;
  border-color: var(--brand-2);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 14px;
}

.image-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.image-chip {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.image-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-chip-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity .15s;
}

.image-chip:hover .image-chip-actions {
  opacity: 1;
}

.image-chip-actions button {
  border: none;
  background: #fff;
  color: #333;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--brand-2);
  color: var(--brand-2);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  max-width: 180px;
}

.upload-btn:hover {
  background: #eef3fb;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .site-header {
    padding: 12px 16px;
  }

  .t-item {
    flex-direction: column;
  }

  .t-thumb {
    flex-basis: auto;
    height: 180px;
  }

  .admin-row {
    flex-wrap: wrap;
  }

  .row-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
