/* ========== 番茄小说平台 - 全局公共样式 ========== */
:root {
  --primary: #F54E00;
  --primary-light: #FF7A3D;
  --primary-lighter: #FFB088;
  --primary-dark: #D43E00;
  --gradient: linear-gradient(135deg, #F54E00 0%, #FF7A3D 100%);
  --gradient-soft: linear-gradient(135deg, #FFF5F0 0%, #FFF0E8 100%);
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --bg: #f5f6fa;
  --card-bg: #fff;
  --text: #2d3436;
  --text-dim: #999;
  --text-secondary: #666;
  --border: #eee;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.3s; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }

/* ========== 通用按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(245, 78, 0, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(245, 78, 0, 0.45); filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: rgba(245, 78, 0, 0.06); }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover { box-shadow: 0 6px 22px rgba(16, 185, 129, 0.45); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-sm { padding: 7px 18px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 36px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

/* ========== 表单元素 ========== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: all 0.3s;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245, 78, 0, 0.08);
}
.form-input::placeholder { color: #bbb; }
textarea.form-input { resize: vertical; min-height: 100px; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-body { padding: 20px; }
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h3 {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header h3 i {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
}

/* ========== 标签徽章 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-primary { background: rgba(245, 78, 0, 0.1); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }

.free-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.fb-green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.fb-paid { background: rgba(245, 158, 11, 0.12); color: #d97706; }

/* ========== 表格 ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: #fafbfc;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.data-table tr:hover td { background: #fafbfc; }
.data-table .cell-monospace { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; }

/* ========== 模态弹窗 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-dim);
  transition: all 0.3s;
}
.modal-close:hover { background: #eee; color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== Toast 提示 ========== */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 28px;
  border-radius: var(--radius);
  background: #333;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.35s ease forwards;
  pointer-events: auto;
  white-space: nowrap;
}
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 空状态 / 加载状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state i {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty-state p { font-size: 15px; margin-bottom: 4px; }
.empty-state .sub { font-size: 13px; opacity: 0.7; }

.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
}
.loading-spinner i {
  animation: spin 1s linear infinite;
  font-size: 28px;
  color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ========== 折叠面板 (用户中心用) ========== */
.collapse-panel {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.cp-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s;
}
.cp-header:hover { background: #fafbfc; }
.cp-left { display: flex; align-items: center; gap: 14px; }
.cp-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  flex-shrink: 0;
}
.cp-info h4 { font-size: 16px; font-weight: 600; }
.cp-info p { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.cp-arrow {
  color: var(--text-dim);
  transition: transform 0.3s;
  font-size: 14px;
}
.cp-header.open .cp-arrow { transform: rotate(180deg); }
.cp-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  border-top: 1px solid transparent;
}
.cp-body.show {
  max-height: 800px;
  border-top-color: var(--border);
}
.cp-inner { padding: 20px 22px; }

/* ========== 页面容器 ========== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main-content { flex: 1; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== 响应式工具类 ========== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .btn-lg { padding: 12px 28px; font-size: 15px; }
  .card-body { padding: 16px; }
  .modal-box { max-width: 94%; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 10px 10px; }
}
