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

:root {
  --primary: #4A90D9;
  --primary-dark: #3A7BC8;
  --success: #52C41A;
  --warning: #FAAD14;
  --danger: #F5222D;
  --text: #333;
  --text-secondary: #666;
  --text-light: #999;
  --bg: #F5F5F5;
  --white: #FFF;
  --border: #E8E8E8;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 90%;
  width: 320px;
  text-align: center;
}
.modal-content p {
  margin-bottom: 20px;
  font-size: 16px;
}
.modal-buttons {
  display: flex;
  gap: 12px;
}
.modal-buttons button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn-cancel {
  background: #E8E8E8;
  color: #666;
}
.btn-confirm {
  background: var(--primary);
  color: white;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:active {
  background: var(--primary-dark);
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-block {
  display: block;
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 输入框 ===== */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}
.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: white;
}
.input-group textarea {
  resize: vertical;
  min-height: 100px;
}
.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
}

/* ===== 卡片 ===== */
.card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.card-meta {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== 列表 ===== */
.list {
  background: white;
}
.list-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.list-item:active {
  background: #F5F5F5;
}
.list-item:last-child {
  border-bottom: none;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ===== 加载 ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.tag-draft { background: #E8E8E8; color: #666; }
.tag-pending { background: #FFF7E6; color: #FA8C16; }
.tag-published { background: #F6FFED; color: #52C41A; }

/* ===== 头部 ===== */
.header {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header h1 {
  font-size: 18px;
  text-align: center;
}
.header-back {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  text-decoration: none;
  font-size: 16px;
}

/* ===== 底部导航 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
  z-index: 100;
}
.nav-item {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  color: var(--text-light);
  text-decoration: none;
  font-size: 12px;
}
.nav-item.active {
  color: var(--primary);
}
.nav-item .icon {
  font-size: 24px;
  display: block;
  margin-bottom: 4px;
}

/* ===== 内容区域 ===== */
.page-content {
  padding: 16px;
  padding-bottom: 70px;
}

/* ===== Flex工具 ===== */
.flex {
  display: flex;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.text-center {
  text-align: center;
}
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mb-10 { margin-bottom: 10px; }
.mb-16 { margin-bottom: 16px; }
