/* ===== 浩峰物流论坛 — 样式 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --primary: #1a56db;
  --primary-hover: #1648c0;
  --accent: #e85d3a;
  --success: #059669;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

html { font-size: 16px; }
body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.logo:hover { text-decoration: none; color: var(--primary); }
.nav { display: flex; align-items: center; gap: 8px; }
.nav-link { color: var(--text-secondary); font-size: 14px; padding: 6px 10px; border-radius: var(--radius); }
.nav-link:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.nav-user { font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 4px; }

/* ===== Main ===== */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
  width: 100%;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 48px 16px 32px;
}
.hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.hero-desc { color: var(--text-secondary); font-size: 15px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== Buttons ===== */
.btn-primary, .btn-outline, .btn-primary-sm {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-primary-sm { padding: 6px 14px; background: var(--primary); color: #fff; font-size: 13px; }
.btn-primary-sm:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }
.btn-block { width: 100%; text-align: center; }
.btn-like {
  background: none;
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.btn-like:hover { border-color: var(--accent); color: var(--accent); }
.btn-like.liked { border-color: var(--accent); color: var(--accent); background: #fef2f0; }
.btn-outline-sm {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-outline-sm:hover { background: var(--primary); color: #fff; text-decoration: none; }
.btn-danger-sm {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger-sm:hover { background: var(--danger); color: #fff; }

/* ===== Sections ===== */
.section { margin-bottom: 32px; }
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.section-header .section-title { border: none; margin-bottom: 4px; }

/* ===== Category Cards ===== */
.categories { display: grid; gap: 12px; }
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.15s;
}
.category-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.category-info h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.category-desc { font-size: 13px; color: var(--text-secondary); }
.category-count { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ===== Post List ===== */
.post-list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.post-row {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.post-row:last-child { border-bottom: none; }
.post-row:hover { background: #f9fafb; }
.post-row-main h3 { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.post-row-main h3 a { color: var(--text); }
.post-row-main h3 a:hover { color: var(--primary); text-decoration: none; }

/* ===== Post Meta ===== */
.post-meta { font-size: 12px; color: var(--text-secondary); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.meta-category, .badge-pinned, .badge-admin, .badge-admin-sm {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 3px;
  font-weight: 500;
}
.meta-category { background: #eef2ff; color: var(--primary); }
.badge-pinned { background: #fef3c7; color: #92400e; }
.badge-admin, .badge-admin-sm { background: #fce7f3; color: #9d174d; }

/* ===== Post Full ===== */
.post-full {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 24px;
}
.post-header { margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.post-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.post-content { font-size: 15px; line-height: 1.8; color: #374151; overflow-wrap: break-word; }
.post-content h1, .post-content h2, .post-content h3 { margin-top: 24px; margin-bottom: 12px; font-weight: 600; }
.post-content h1 { font-size: 22px; }
.post-content h2 { font-size: 19px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.post-content h3 { font-size: 17px; }
.post-content p { margin-bottom: 12px; }
.post-content ul, .post-content ol { margin-bottom: 12px; padding-left: 24px; }
.post-content li { margin-bottom: 4px; }
.post-content blockquote {
  margin: 12px 0;
  padding: 8px 16px;
  border-left: 4px solid var(--primary);
  background: #f8faff;
  color: #555;
}
.post-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  font-family: "SF Mono", Monaco, monospace;
}
.post-content pre {
  background: #1a1a2e;
  color: #e5e7eb;
  padding: 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 16px;
}
.post-content pre code { background: none; padding: 0; color: inherit; font-size: 13px; }
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.post-content th { background: #f9fafb; font-weight: 600; }
.post-content img { max-width: 100%; height: auto; border-radius: 4px; margin: 12px 0; }
.post-content a { color: var(--primary); }
.post-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.post-actions-left { display: flex; align-items: center; gap: 8px; }
.post-actions-right { display: flex; align-items: center; gap: 8px; }

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }

/* ===== Comments ===== */
.comments { }
.comment-form { margin-bottom: 20px; }
.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 8px;
}
.comment-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.login-tip { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.comment-list { }
.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }
.comment-header { font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.comment-date { color: var(--text-secondary); font-size: 12px; }
.comment-body { font-size: 14px; line-height: 1.7; color: #374151; }

/* ===== Auth Pages ===== */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 48px;
}
.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 22px; margin-bottom: 20px; text-align: center; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.auth-link { text-align: center; font-size: 14px; color: var(--text-secondary); margin-top: 16px; }

/* ===== Create Post ===== */
.form-page {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
}
.form-page h1 { font-size: 20px; margin-bottom: 20px; }
.post-form .form-group { margin-bottom: 16px; }
.post-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.post-form input[type="text"], .post-form select, .post-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
.post-form input:focus, .post-form select:focus, .post-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-actions { display: flex; gap: 12px; margin-top: 20px; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ===== Utility ===== */
.empty { text-align: center; color: var(--text-secondary); padding: 32px; font-size: 14px; }
.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 22px; }
  .post-row { padding: 12px 14px; }
  .post-full { padding: 16px; }
  .post-title { font-size: 18px; }
  .auth-card { padding: 24px 16px; }
  .form-page { padding: 16px; }
  .section-header { flex-direction: column; gap: 12px; }
}
