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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 导航栏 */
.navbar {
  background: #2c3e50;
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s;
}

.nav-links a:hover {
  opacity: 0.8;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #3498db;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 1rem;
}

.btn:hover {
  background: #2980b9;
}

.btn-primary {
  background: #3498db;
}

.btn-secondary {
  background: #95a5a6;
}

.btn-success {
  background: #27ae60;
}

.btn-danger {
  background: #e74c3c;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* 认证页面 */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.auth-box h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-link {
  text-align: center;
  margin-top: 1rem;
}

.error {
  background: #fee;
  color: #c33;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* 首页 */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 8px;
  margin-top: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* 卡片 */
.card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-info {
  flex: 1;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

/* 仪表板部分 */
.dashboard-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.section-header h2 {
  margin: 0;
  font-size: 1.3rem;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  transition: background 0.3s;
}

.recent-item:hover {
  background: #e9ecef;
}

.recent-info {
  flex: 1;
}

.recent-info h4 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
}

.recent-time {
  color: #666;
  font-size: 0.85rem;
  display: block;
  margin-top: 0.25rem;
}

.invite-code-display {
  display: block;
  color: #3498db;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.invite-code-display strong {
  font-family: monospace;
  background: #e3f2fd;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
}

.empty-hint {
  color: #666;
  text-align: center;
  padding: 2rem;
}

.empty-hint a {
  color: #3498db;
  text-decoration: none;
}

.empty-hint a:hover {
  text-decoration: underline;
}

/* 表格 */
.data-table {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* 页面头部 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* 复选框列表 */
.checkbox-list {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.checkbox-item {
  display: block;
  padding: 0.5rem;
  cursor: pointer;
}

.checkbox-item:hover {
  background: #f8f9fa;
}

.checkbox-item input {
  margin-right: 0.5rem;
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-active {
  background: #d4edda;
  color: #155724;
}

.badge-used {
  background: #f8d7da;
  color: #721c24;
}

.badge-expired {
  background: #f8d7da;
  color: #721c24;
}

.badge-exhausted {
  background: #fff3cd;
  color: #856404;
}

.form-hint {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* 邀请码输入 */
.invite-code-input {
  margin: 2rem 0;
}

.input-group {
  display: flex;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 6px;
}

.input-group input {
  border: none !important;
  outline: none;
}

.input-group input:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-group button {
  margin: 0;
  white-space: nowrap;
}

/* 文章列表 */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-card h3 {
  margin-bottom: 0.5rem;
}

.article-card h3 a {
  color: #2c3e50;
  text-decoration: none;
}

.article-card h3 a:hover {
  color: #3498db;
}

.article-meta {
  color: #666;
  font-size: 0.9rem;
}

/* 文章内容 */
.article-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: 2rem;
}

.article-content h1 {
  margin-bottom: 1rem;
}

.article-content .article-meta {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

/* 文章组网格 */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.group-description {
  color: #666;
  margin-bottom: 2rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 8px;
  margin-top: 2rem;
}

.empty-state p {
  color: #666;
  margin-bottom: 0.5rem;
}

/* 错误页面 */
.error-page {
  text-align: center;
  padding: 3rem;
  background: white;
  border-radius: 8px;
  margin-top: 2rem;
}

.error-page h1 {
  color: #e74c3c;
  margin-bottom: 1rem;
}
