:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --primary-hover: #4285f4;
  --secondary: #0d47a1;
  --accent: #448aff;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5f6368;
  --border: #e0e4e8;
  --success: #0f9d58;
  --warning: #f4b400;
  --danger: #db4437;
  --vip-gold: #f5a623;
  --vip-bg: linear-gradient(135deg, #1a73e8, #0d47a1);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --transition: all 0.3s ease;
}

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

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

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

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Header */
.header {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(26, 115, 232, 0.3);
}

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

.logo { font-size: 24px; font-weight: 700; color: white; display: flex; align-items: center; gap: 10px; }
.logo img { height: 36px; }
.logo:hover { color: rgba(255,255,255,0.9); }

.nav { display: flex; gap: 8px; }
.nav a {
  color: rgba(255,255,255,0.85);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition);
}
.nav a:hover, .nav a.active { background: rgba(255,255,255,0.15); color: white; }

.user-nav { display: flex; align-items: center; gap: 12px; }
.user-nav a { color: white; padding: 6px 16px; border-radius: 8px; font-size: 14px; transition: var(--transition); }
.btn-outline { border: 1.5px solid rgba(255,255,255,0.5); }
.btn-outline:hover { background: rgba(255,255,255,0.15); border-color: white; }
.btn-primary { background: white; color: var(--primary) !important; font-weight: 600; }
.btn-primary:hover { background: var(--primary-light); }

.badge-vip {
  background: linear-gradient(135deg, var(--vip-gold), #ff9800);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

/* Hero section */
.hero {
  background: linear-gradient(135deg, var(--secondary), #1a5dc4);
  color: white;
  padding: 80px 0 60px;
  text-align: center;
}

.hero h1 { font-size: 42px; font-weight: 800; margin-bottom: 16px; letter-spacing: -1px; }
.hero p { font-size: 18px; opacity: 0.9; margin-bottom: 32px; }

.search-box {
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.search-box input {
  flex: 1;
  padding: 16px 24px;
  border: none;
  font-size: 16px;
  outline: none;
  color: var(--text);
}

.search-box button {
  padding: 16px 36px;
  background: var(--primary);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-box button:hover { background: var(--primary-dark); }

/* Stats bar */
.stats-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.stats-bar .container { display: flex; justify-content: center; gap: 48px; }

.stat-item { text-align: center; }
.stat-item .num { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-item .label { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* Section */
.section { padding: 48px 0; }
.section-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title .more { font-size: 14px; color: var(--text-secondary); font-weight: 400; }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
  overflow: hidden;
}

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

.card-body { padding: 20px; }

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .nav { display: none; }
}

/* Resource Card */
.resource-card { padding: 20px; }
.resource-card .name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.resource-card .meta { font-size: 13px; color: var(--text-secondary); display: flex; gap: 16px; }
.resource-card .tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 6px;
}

/* Software Card */
.software-card { padding: 24px; text-align: center; }
.software-card .icon { font-size: 48px; margin-bottom: 12px; }
.software-card .name { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.software-card .desc { font-size: 14px; color: var(--text-secondary); }

/* Demand Card */
.demand-card { padding: 20px; }
.demand-card .name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.demand-card .reward {
  display: inline-block;
  background: var(--danger);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}
.demand-card .status { font-size: 13px; margin-top: 8px; }
.demand-card .status.open { color: var(--success); }
.demand-card .status.fulfilled { color: var(--text-secondary); }

/* Announcement */
.announcement-list { display: flex; flex-direction: column; gap: 12px; }
.announcement-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.announcement-item:hover { border-color: var(--primary); background: var(--primary-light); }
.announcement-item .pin { color: var(--danger); font-weight: 700; }
.announcement-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.announcement-item .content { flex: 1; font-size: 15px; }
.announcement-item .time { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* Detail Page */
.detail-page { padding: 40px 0; }
.detail-header { margin-bottom: 32px; }
.detail-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.detail-header .meta { color: var(--text-secondary); font-size: 14px; }
.detail-header .meta span { margin-right: 20px; }

.detail-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 32px;
}

.detail-content h2 { font-size: 22px; margin: 24px 0 12px; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.info-table th {
  width: 120px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
}

.qr-code { text-align: center; padding: 20px; }
.qr-code img { max-width: 200px; border-radius: 8px; }
.qr-code .pass-text { margin-top: 12px; font-size: 14px; color: var(--text-secondary); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-blue { background: var(--primary); color: white; }
.btn-blue:hover { background: var(--primary-dark); color: white; }
.btn-outline-blue { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-blue:hover { background: var(--primary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 6px 16px; font-size: 13px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: var(--transition);
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }

.form-card {
  max-width: 480px;
  margin: 60px auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: var(--shadow);
}

.form-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.form-card .subtitle { color: var(--text-secondary); margin-bottom: 32px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}
.alert-error { background: #fce8e6; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-success { background: #e6f4ea; color: var(--success); border: 1px solid #c3e6cb; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination a, .pagination span {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  transition: var(--transition);
}
.pagination a:hover { background: var(--primary-light); }
.pagination .current { background: var(--primary); color: white; border-color: var(--primary); }

/* Footer */
.footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.footer h4 { color: white; font-size: 16px; margin-bottom: 16px; }
.footer a { color: rgba(255,255,255,0.7); font-size: 14px; display: block; margin-bottom: 8px; }
.footer a:hover { color: white; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 13px;
}

/* Admin Layout */
.admin-layout { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 24px 0;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  padding: 12px 24px;
  color: var(--text);
  font-size: 15px;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
}
.admin-content { flex: 1; padding: 32px; background: var(--bg); }

/* Table */
.table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; }
.table th { background: var(--primary-light); padding: 14px 16px; text-align: left; font-size: 14px; color: var(--primary); font-weight: 600; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table tr:hover td { background: #f8f9fa; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-active { background: #e6f4ea; color: var(--success); }
.status-reported { background: #fef7e0; color: var(--warning); }
.status-removed { background: #fce8e6; color: var(--danger); }
.status-pending { background: #e8f0fe; color: var(--primary); }

/* Report Button */
.report-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.report-section h3 { font-size: 18px; margin-bottom: 16px; }
.report-buttons { display: flex; gap: 12px; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h3 { font-size: 20px; margin-bottom: 20px; }

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.category-tabs a {
  padding: 8px 20px;
  border-radius: 20px;
  background: white;
  border: 1.5px solid var(--border);
  font-size: 14px;
  transition: var(--transition);
  color: var(--text);
}
.category-tabs a:hover, .category-tabs a.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Rich text content */
.rich-content img { max-width: 100%; border-radius: 8px; }
.rich-content video { max-width: 100%; border-radius: 8px; }
.rich-content p { margin-bottom: 12px; }
.rich-content h2, .rich-content h3 { margin: 20px 0 12px; }

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }

/* VIP highlight */
.vip-highlight {
  background: var(--vip-bg);
  color: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.vip-highlight h3 { font-size: 20px; margin-bottom: 8px; }
.vip-highlight p { opacity: 0.9; font-size: 14px; }
