/* ========== 书香风格全局样式 ========== */
:root {
  --bg-parchment: #f5f0e8;
  --bg-card: #fffef9;
  --bg-admin: #faf7f0;
  --text-primary: #3d3226;
  --text-secondary: #6b5e4f;
  --text-muted: #9a8c7a;
  --accent: #8b7355;
  --accent-light: #c9a96e;
  --border: #d4c5b2;
  --border-light: #e8ddd0;
  --shadow: 0 2px 12px rgba(61, 50, 38, 0.08);
  --shadow-hover: 0 6px 24px rgba(61, 50, 38, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: "Noto Serif SC", "STSong", "SimSun", "Songti SC", "宋体", Georgia, serif;
  background-color: var(--bg-parchment);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201, 169, 110, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 115, 85, 0.04) 0%, transparent 50%);
}

/* ========== 导航栏 ========== */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(61, 50, 38, 0.04);
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.navbar-brand::before {
  content: "\2384";
  margin-right: 0.5rem;
  font-size: 1.3rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--accent);
  background: rgba(139, 115, 85, 0.06);
}

.nav-link.active {
  color: var(--accent);
  background: rgba(139, 115, 85, 0.1);
}

.nav-link.admin-link {
  border: 1px solid var(--border);
  margin-left: 0.5rem;
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
}

/* ========== 英雄区域 ========== */
.hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
  border-radius: 2px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.04em;
}

/* ========== 装饰分隔线 ========== */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem auto 2rem;
  max-width: 200px;
  color: var(--border);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.divider-icon {
  font-size: 1.2rem;
  color: var(--accent-light);
  opacity: 0.6;
}

/* ========== 容器 ========== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ========== 分类区块 ========== */
.category-section {
  margin-bottom: 3rem;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-light);
  position: relative;
}

.category-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: var(--accent-light);
}

.category-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 115, 85, 0.1), rgba(201, 169, 110, 0.15));
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  color: var(--accent);
}

.category-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.category-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ========== 卡片网格 ========== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-light), transparent);
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--border);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card-company {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(139, 115, 85, 0.08), rgba(201, 169, 110, 0.1));
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.card-company::before {
  content: "\2666";
  font-size: 0.6rem;
  opacity: 0.5;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.card-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(212, 197, 178, 0.3);
  color: var(--text-muted);
  font-family: "Noto Serif SC", serif;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-style: italic;
}

.empty-state-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.4;
}

/* ========== 底部 ========== */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
  letter-spacing: 0.03em;
}

.footer-line {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--border);
  vertical-align: middle;
  margin: 0 0.75rem;
}

/* ========== 后台管理页 ========== */
.admin-body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.admin-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: 1.5rem 2rem;
  text-align: center;
}

.admin-header h1 {
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: 1.5rem;
  color: var(--text-primary);
  letter-spacing: 0.04em;
}

.admin-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  transition: var(--transition);
}

.back-link:hover {
  color: var(--text-primary);
}

.admin-container {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem 4rem;
}

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.admin-section h2 {
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: 0.03em;
}

/* 表单 */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-parchment);
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
}

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

.btn-primary:hover {
  background: #7a6348;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(139, 115, 85, 0.04);
}

.btn-danger {
  background: transparent;
  border: 1px solid #d4a0a0;
  color: #a06060;
}

.btn-danger:hover {
  background: rgba(180, 100, 100, 0.08);
  border-color: #c08080;
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* 分类标签列表 */
.category-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(139, 115, 85, 0.08), rgba(201, 169, 110, 0.1));
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.category-tag:hover {
  border-color: var(--accent-light);
}

.category-tag.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.category-tag .tag-count {
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.3);
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
}

.category-tag.active .tag-count {
  background: rgba(255, 255, 255, 0.25);
}

/* 项目列表 */
.item-list {
  list-style: none;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  background: var(--bg-parchment);
  transition: var(--transition);
  gap: 1rem;
}

.item-row:hover {
  border-color: var(--border);
}

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

.item-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.item-company-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(201, 169, 110, 0.15);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 22, 14, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 2rem;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.modal h3 {
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 提示消息 */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--text-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  animation: slideIn 0.3s ease;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .hero {
    padding: 3rem 1rem 2rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .navbar {
    padding: 0 1rem;
  }

  .admin-container {
    padding: 0 1rem 3rem;
  }
}

/* ========== 打印样式优化 ========== */
@media print {
  .navbar,
  .footer,
  .nav-link.admin-link {
    display: none;
  }

  body {
    background: white;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}
