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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #f59e0b;
  --text: #1e293b;
  --text-secondary: #64748b;
  --bg: #f1f5f9;
  --white: #ffffff;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-publish-btn {
  background: var(--accent);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.nav-publish-btn:hover {
  background: #d97706;
  color: white;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); color: white; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; color: white; }

.btn-lg {
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 10px;
}

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

.btn-block {
  width: 100%;
}

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

/* Hero / Banner */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  margin-bottom: 32px;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.hero-search {
  display: flex;
  max-width: 560px;
  position: relative;
  z-index: 1;
}

.hero-search input {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 10px 0 0 10px;
  font-size: 15px;
  outline: none;
}

.hero-search button {
  padding: 14px 28px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover { background: #d97706; }

/* Categories */
.categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

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

.category-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.category-icon {
  font-size: 36px;
  line-height: 1;
}

.category-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.category-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.category-count {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 700;
}

/* Post List */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid var(--border);
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.post-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.post-card:hover .post-title { color: var(--primary); }

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

.post-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.tag-tech { background: #dbeafe; color: #1d4ed8; }
.tag-design { background: #fce7f3; color: #be185d; }

/* Detail Page */
.detail-container {
  max-width: 800px;
  margin: 0 auto;
}

.detail-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.detail-category {
  margin-bottom: 16px;
}

.detail-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
}

.detail-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 20px;
}

.detail-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 24px;
  white-space: pre-line;
}

.detail-info {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.detail-info-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  font-size: 15px;
}

.detail-info-label {
  width: 80px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-info-value {
  color: var(--text);
  font-weight: 500;
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.contact-card h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

.contact-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Forms */
.form-container {
  max-width: 480px;
  margin: 40px auto;
}

.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.form-card h2 {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.form-card .form-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-footer a { font-weight: 500; }

.form-msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

.form-msg.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  display: block;
}

.form-msg.success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
  display: block;
}

/* Publish Form */
.publish-container {
  max-width: 680px;
  margin: 0 auto;
}

.publish-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
}

.publish-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* Toast */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 32px;
  margin-bottom: 32px;
  padding: 20px 28px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.modal p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.modal-btns {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  padding: 6px 0;
  z-index: 200;
  margin-top: 8px;
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 18px;
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.15s;
}

.nav-dropdown-menu a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

/* Policy Pages */
.policy-container {
  max-width: 860px;
  margin: 0 auto;
}

.policy-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.policy-title {
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary);
}

.policy-content .policy-h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.policy-content .policy-h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 16px;
  margin-bottom: 8px;
}

.policy-content .policy-p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 10px;
  text-align: justify;
  text-indent: 2em;
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; }
  .nav-links { display: none; }
  .hero { padding: 32px 24px; }
  .hero h1 { font-size: 24px; }
  .categories { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-bar { gap: 20px; flex-wrap: wrap; }
  .detail-card { padding: 24px; }
  .form-card { padding: 28px; }
  .post-header { flex-direction: column; gap: 8px; }
}
