/* ========== 全局样式重置 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #10b981;
  --danger: #ef4444;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

/* ========== 密码验证遮罩 ========== */
.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.auth-card h2 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

.auth-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-card input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition);
  margin-bottom: 16px;
}

.auth-card input:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.error-msg {
  color: var(--danger);
  font-size: 14px;
  margin-top: 12px;
  min-height: 20px;
}

/* ========== 主内容区 ========== */
.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.header {
  text-align: center;
  margin-bottom: 40px;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

/* ========== 公告区域 ========== */
.announcement-section {
  margin-bottom: 32px;
  animation: fadeIn 0.5s ease;
}

.announcement-card {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* 左侧装饰条 */
.announcement-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #f59e0b, #fbbf24);
}

.announcement-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.announcement-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.announcement-title {
  font-size: 18px;
  font-weight: 700;
  color: #92400e;
  margin: 0;
}

.announcement-content {
  font-size: 15px;
  line-height: 1.75;
  color: #78350f;
  white-space: pre-wrap;
  word-break: break-word;
  padding-left: 34px;
}

/* ========== 资源卡片网格 ========== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.resource-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

/* 悬浮交互效果 */
.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.resource-card:active {
  transform: translateY(-2px);
}

/* 卡片顶部装饰条 */
.resource-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  opacity: 0;
  transition: opacity var(--transition);
}

.resource-card:hover::before {
  opacity: 1;
}

.resource-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.resource-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.resource-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.resource-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.download-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  transition: background var(--transition);
}

.resource-card:hover .download-badge {
  background: var(--primary);
  color: #fff;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

/* ========== 页脚 ========== */
.footer {
  text-align: center;
  margin-top: 48px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ========== Toast 提示 ========== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  animation: toastIn 0.3s ease;
  white-space: nowrap;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ========== 移动端适配 ========== */
@media (max-width: 640px) {
  .auth-card {
    padding: 32px 24px;
  }

  .header h1 {
    font-size: 22px;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .resource-card {
    padding: 20px;
  }

  .main-content {
    padding: 24px 16px;
  }

  .announcement-card {
    padding: 16px 18px;
  }

  .announcement-title {
    font-size: 16px;
  }

  .announcement-content {
    font-size: 14px;
    padding-left: 0;
    margin-top: 4px;
  }

  .announcement-header {
    margin-bottom: 10px;
  }
}
