/* ========================================
   AppStore-Web — 现代商务风格
   配色：深蓝主色调、极简留白、精致阴影
   ======================================== */

:root {
  --primary: #1a56db;
  --primary-hover: #1e40af;
  --primary-light: #e8f0fe;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f6f7f9;
  --bg-white: #ffffff;
  --border: #e2e5ea;
  --border-light: #f0f1f3;
  --text: #181c27;
  --text-secondary: #5a6170;
  --text-muted: #9499a3;
  --text-light: #b8bcc4;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --max-width: 1200px;
  --gap: 24px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ===== Layout ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gap); }

/* ===== Header — 深色毛玻璃 ===== */
.site-header {
  background: rgba(16, 23, 42, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.site-logo:hover { color: #e0e7ff; }
.site-logo .logo-icon { margin-right: 0; }
.site-nav { display: flex; gap: 2px; align-items: center; }
.site-nav a {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.site-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
}
.site-nav a.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
}

/* ===== Footer — 透明毛玻璃 ===== */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 36px 0;
  margin-top: 80px;
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  text-align: center;
  background: rgba(16,23,42,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.site-footer a { color: rgba(255,255,255,0.6); }
.site-footer a:hover { color: rgba(255,255,255,0.9); }

/* ===== Cards — 毛玻璃卡片 ===== */
.card {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--gap);
  margin: 28px 0;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card-title {
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.card-desc a { color: var(--primary); }
.card-desc strong { color: var(--text); }
.card-desc code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: #1e40af;
}
.card-desc pre {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 13px;
  margin: 8px 0;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.card-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
}

/* ===== Buttons — 精致按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 550;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(26,86,219,0.3); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; box-shadow: 0 2px 6px rgba(26,86,219,0.35); transform: translateY(-1px); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; color: #fff; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; transform: translateY(-1px); }
.btn-outline { background: var(--bg-white); color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); border-color: #cbd5e1; transform: translateY(-1px); }
.btn-sm { padding: 5px 13px; font-size: 13px; border-radius: 5px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }

/* ===== Forms — 精致表单 ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-white);
  transition: all var(--transition);
  line-height: 1.5;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1), 0 1px 2px rgba(0,0,0,0.04);
}
.form-input::placeholder { color: var(--text-light); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 13px; color: var(--danger); margin-top: 4px; }
textarea.form-input { min-height: 100px; 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='%23949a9' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ===== Alerts ===== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid;
  line-height: 1.6;
}
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 550;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-pass { background: #d1fae5; color: #065f46; }
.badge-reject { background: #fee2e2; color: #991b1b; }
.badge-active { background: #d1fae5; color: #065f46; }
.badge-archived { background: #f1f5f9; color: #64748b; }

/* ===== Tables — 毛玻璃表格 ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead { background: #f8fafc; }
th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }

/* ===== Search ===== */
.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  max-width: 520px;
}
.search-bar .form-input { flex: 1; }

/* ===== Page Header ===== */
.page-header {
  padding: 36px 0 24px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.02em;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-top: 8px;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 36px;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-white);
  transition: all var(--transition);
}
.pagination a:hover { background: #f1f5f9; border-color: #cbd5e1; }
.pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(26,86,219,0.3);
}

/* ===== Install Wizard ===== */
.install-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}
.install-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.install-step.active { color: var(--primary); border-bottom-color: var(--primary); }
.install-step.done { color: var(--success); border-bottom-color: var(--success); }
.install-step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-muted);
}
.install-step.active .step-num { background: var(--primary); color: #fff; }
.install-step.done .step-num { background: var(--success); color: #fff; }

/* ===== Section ===== */
.section-title {
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .site-header .container { flex-wrap: wrap; height: auto; padding: 10px var(--gap); }
  .site-nav { width: 100%; justify-content: flex-start; margin-top: 8px; overflow-x: auto; }
  .card-grid { grid-template-columns: 1fr; }
  .page-header { padding: 24px 0 18px; }
  .page-header h1 { font-size: 22px; }
  .search-bar { max-width: 100%; flex-direction: column; }
}

/* ===== Logo ===== */
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  margin-right: 8px;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}
.empty-state h3 {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* ===== Detail page ===== */
.detail-header { margin-bottom: 28px; }
.detail-header h1 { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-muted);
  font-size: 13.5px;
  margin-top: 12px;
}
.detail-content {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-content a { color: var(--primary); }
.detail-content strong { color: var(--text); }
.detail-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13.5px;
}
.detail-content pre {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  margin: 12px 0;
}

/* ===== Admin sidebar ===== */
.admin-layout { display: flex; min-height: calc(100vh - 160px); }
.admin-sidebar {
  width: 230px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: block;
  padding: 11px 24px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.admin-sidebar a:hover { background: #f8fafc; color: var(--text); }
.admin-sidebar a.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.admin-main { flex: 1; padding: 28px 36px; min-width: 0; background: var(--bg); }
@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; padding: 8px; }
  .admin-sidebar a { padding: 8px 14px; font-size: 13px; border-left: none; border-bottom: 2px solid transparent; }
  .admin-sidebar a.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .admin-main { padding: 16px; }
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.modal h3 { font-size: 18px; font-weight: 650; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ===== File upload area ===== */
.upload-area {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.upload-area:hover { border-color: var(--primary); background: rgba(26,86,219,0.04); }

/* ========================================
   细节动画 & 毛玻璃特效
   ======================================== */

/* 页面加载渐入 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.page-header  { animation: fadeInUp 0.5s ease-out; }
.card         { animation: fadeInUp 0.5s ease-out both; }
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.alert       { animation: fadeIn 0.35s ease-out; }
.modal       { animation: scaleIn 0.3s ease-out; }

/* 卡片交互微动效 */
.card {
  transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* 按钮波纹 */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.btn:active::after { opacity: 1; transition: opacity 0s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 4px 14px rgba(26,86,219,0.35); }
.btn-danger:hover  { box-shadow: 0 4px 14px rgba(220,38,38,0.3); }
.btn-success:hover { box-shadow: 0 4px 14px rgba(5,150,105,0.3); }

/* 侧边栏 hover 滑入 */
.admin-sidebar a {
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-sidebar a:hover {
  padding-left: 28px;
  background: #f8fafc;
}

/* 导航栏滑入动画 */
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.site-header { animation: slideDown 0.4s ease-out; }

/* 导航链接下划线动效 */
.site-nav a {
  position: relative;
}
.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #60a5fa;
  border-radius: 1px;
  transition: all 0.25s ease;
  transform: translateX(-50%);
}
.site-nav a:hover::after,
.site-nav a.active::after {
  width: 20px;
}

/* 毛玻璃卡片（可选类） */
.glass {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

/* 毛玻璃弹窗 */
.modal-overlay {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.3s ease;
}
.modal {
  animation: scaleIn 0.3s ease-out;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.4);
}

/* 表格行滑入 */
tbody tr {
  animation: fadeIn 0.4s ease-out both;
}
tbody tr:nth-child(1)  { animation-delay: 0.03s; }
tbody tr:nth-child(2)  { animation-delay: 0.06s; }
tbody tr:nth-child(3)  { animation-delay: 0.09s; }
tbody tr:nth-child(4)  { animation-delay: 0.12s; }
tbody tr:nth-child(5)  { animation-delay: 0.15s; }
tbody tr:nth-child(6)  { animation-delay: 0.18s; }
tbody tr:nth-child(7)  { animation-delay: 0.21s; }
tbody tr:nth-child(8)  { animation-delay: 0.24s; }
tbody tr:nth-child(9)  { animation-delay: 0.27s; }
tbody tr:nth-child(10) { animation-delay: 0.3s; }
tbody tr:nth-child(n+11) { animation-delay: 0.33s; }

/* 公告弹窗毛玻璃 */
.notice-modal {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.5);
}

/* 输入框 focus 呼吸光环 */
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
  50%      { box-shadow: 0 0 0 6px rgba(26,86,219,0.06); }
}
.form-input:focus {
  animation: breathe 2s ease-in-out infinite;
}

/* 头像 hover 放大 */
.avatar-text, .card img[style*="border-radius:50%"] {
  transition: transform 0.25s ease;
}
.avatar-text:hover, .card img[style*="border-radius:50%"]:hover {
  transform: scale(1.15);
}

/* 友情链接卡片 hover */
.card a[target="_blank"] {
  transition: all 0.2s ease;
}
.card a[target="_blank"]:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}
