/* ============ 全局重置 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #4F7CFF;
  --primary-dark: #3B66E0;
  --primary-light: #EEF3FF;
  --success: #52C41A;
  --warning: #FA8C16;
  --danger: #F5222D;
  --info: #1890FF;
  --text-1: #1A1A1A;
  --text-2: #555;
  --text-3: #999;
  --border: #E8E8E8;
  --bg-page: #F5F6FA;
  --bg-card: #FFFFFF;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --sidebar-w: 220px;
  --header-h: 60px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
  color: var(--text-1);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D0D0D0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B0B0B0; }

/* ============ 通用组件 ============ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-default {
  background: #fff;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-default:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-text {
  background: transparent;
  color: var(--primary);
  padding: 4px 8px;
  font-size: 13px;
}
.btn-text:hover { opacity: .8; }
.btn-text.danger { color: var(--danger); }
.btn-text.success { color: var(--success); }

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ============ 入口页 ============ */
.entry-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 20px;
}
.entry-header { text-align: center; margin-bottom: 50px; color: #fff; }
.entry-header h1 { font-size: 36px; font-weight: 700; margin-bottom: 10px; letter-spacing: 2px; }
.entry-header p { font-size: 16px; opacity: .85; }
.entry-cards {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1100px;
}
.entry-card {
  width: 300px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.entry-card:hover { transform: translateY(-8px); box-shadow: 0 30px 80px rgba(0,0,0,0.2); }
.entry-card .icon {
  width: 80px; height: 80px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
}
.entry-card h3 { font-size: 20px; margin-bottom: 8px; color: var(--text-1); }
.entry-card p { font-size: 13px; color: var(--text-3); line-height: 1.6; margin-bottom: 20px; }
.entry-card .features { text-align: left; }
.entry-card .features li {
  font-size: 13px; color: var(--text-2);
  padding: 4px 0; padding-left: 20px;
  position: relative;
}
.entry-card .features li::before {
  content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: bold;
}
.entry-card .enter-btn {
  margin-top: 24px;
  padding: 12px 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  transition: all .3s;
}

/* ============ 手机模拟器外壳 ============ */
.phone-frame {
  width: 100%;
  max-width: 414px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
  position: relative;
  overflow-x: hidden;
}
.phone-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 50px 20px 20px;
  position: relative;
}
.phone-header .nav-back {
  position: absolute;
  left: 16px; top: 50px;
  font-size: 22px;
  cursor: pointer;
  opacity: .9;
}
.phone-header h2 { font-size: 18px; font-weight: 600; }

/* 小程序底部Tab栏 */
.tab-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 414px;
  background: #fff;
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-bar .tab-item {
  flex: 1;
  text-align: center;
  padding: 8px 0 10px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.tab-bar .tab-item .tab-icon { font-size: 22px; }
.tab-bar .tab-item .tab-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.tab-bar .tab-item.active .tab-label { color: var(--primary); font-weight: 600; }
.tab-bar .tab-item.active .tab-icon { transform: scale(1.1); }

/* 小程序页面内容区 */
.phone-content {
  padding-bottom: 70px;
  min-height: 100vh;
}

/* 页面切换 */
.page { display: none; }
.page.active { display: block; }

/* ============ 通用列表 ============ */
.list-item {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

/* ============ 模态框 ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { transform: scale(.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 17px; }
.modal-header .close { font-size: 24px; cursor: pointer; color: var(--text-3); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 8px;
  font-weight: 500;
}
.form-group label .req { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color .2s;
  background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,124,255,0.1);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ============ Switch 开关 ============ */
.switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
}
.switch input { display: none; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  transition: .3s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: toastIn .3s ease;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ============ 公告栏 ============ */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  margin: 12px 0 16px;
  background: #FFF7E6;
  border: 1px solid #FFE7BA;
  border-radius: 10px;
  color: #8C5B00;
  cursor: pointer;
  overflow: hidden;
}
.notice-bar:hover { border-color: #FAAD14; }
.nb-icon { font-size: 16px; flex: 0 0 auto; }
.nb-scroll { flex: 1; overflow: hidden; white-space: nowrap; }
.nb-scroll span {
  display: inline-block;
  min-width: 100%;
  font-size: 13px;
  line-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}
.nb-arrow { flex: 0 0 auto; font-size: 22px; line-height: 1; color: #D48806; }
.ann-item {
  background: #fff;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.ann-item:active { transform: scale(.99); }
.ann-item:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.ann-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ann-pin {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  color: #F5222D;
  background: #FFF1F0;
}
.ann-type {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
}
.ann-content {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ann-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  color: var(--text-3);
  font-size: 11px;
}
.ann-detail-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ============ 空状态 ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
