:root {
  --primary: #ff4d6d;
  --primary-dark: #e63956;
  --ink: #2b2233;
  --muted: #8a8290;
  --bg: #f6f7fb;
  --line: #e9eaf0;
  --card: #fff;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: var(--bg); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #ff8fa3); color: #fff; border: none; padding: 11px 22px; border-radius: 10px; font-weight: 600; cursor: pointer; font-size: 14px; }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(255,77,109,.3); }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-outline:hover { background: #fff0f3; }

/* 登录 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#ffd6e0,#fff0f3); }
.login-box { background: #fff; padding: 40px 36px; border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.12); width: 340px; text-align: center; }
.login-logo-img { width: 72px; height: 72px; object-fit: contain; margin: 0 auto 10px; filter: drop-shadow(0 6px 16px rgba(246,183,60,.4)); }
.login-logo { font-size: 24px; font-weight: 800; color: var(--primary-dark); }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 24px; }
.login-box input { width: 100%; padding: 12px 14px; margin-bottom: 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; }
.login-box input:focus { outline: none; border-color: var(--primary); }
.login-box .btn-primary { width: 100%; padding: 13px; font-size: 16px; }
.login-tip { margin-top: 12px; font-size: 13px; min-height: 18px; }
.login-tip.err { color: var(--primary-dark); }
.login-tip.ok { color: #2e9e5b; }

/* 布局 */
.admin { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logo { padding: 18px 20px; font-weight: 800; color: var(--primary-dark); font-size: 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.side-logo img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(255,77,109,.25)); }
.side-nav { flex: 1; padding: 14px 12px; }
.nav-item { display: block; padding: 12px 16px; border-radius: 10px; color: var(--muted); font-weight: 600; cursor: pointer; margin-bottom: 4px; }
.nav-item:hover { background: #fff0f3; color: var(--primary); }
.nav-item.active { background: linear-gradient(135deg, var(--primary), #ff8fa3); color: #fff; }
.side-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.btn-logout { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; color: var(--muted); }

.content { flex: 1; padding: 30px 36px; overflow: auto; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel h1 { font-size: 24px; margin-bottom: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.panel-head h1 { margin: 0; }

/* 概览卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: 0 4px 14px rgba(0,0,0,.05); border: 1px solid var(--line); }
.stat-card .num { font-size: 34px; font-weight: 800; color: var(--primary-dark); }
.stat-card .label { color: var(--muted); margin-top: 6px; font-size: 14px; }

/* 表格 */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.05); overflow: hidden; border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 16px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); }
.data-table th { background: #fafbff; color: var(--muted); font-weight: 600; }
.data-table tr:last-child td { border-bottom: none; }
.mini-photo { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #eee; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.published { background: #e6f7ee; color: #2e9e5b; }
.badge.draft { background: #fff3e0; color: #d98600; }
.badge.pending { background: #fff0f3; color: var(--primary); }
.badge.rejected { background: #fdecec; color: #d33; }
.badge.approved { background: #e6f7ee; color: #2e9e5b; }
.row-actions { display: flex; gap: 8px; }
.empty { text-align: center; color: var(--muted); padding: 30px; }

/* 申请卡片 */
.filter-tabs { display: flex; gap: 10px; margin-bottom: 20px; }
.filter-tabs .tab { padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--muted); font-weight: 600; cursor: pointer; }
.filter-tabs .tab.active { background: linear-gradient(135deg, var(--primary), #ff8fa3); color: #fff; border-color: transparent; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.app-card { background: var(--card); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0,0,0,.05); border: 1px solid var(--line); overflow: hidden; }
.app-top { display: flex; gap: 14px; padding: 16px; }
.app-top img { width: 72px; height: 90px; border-radius: 12px; object-fit: cover; background: #eee; }
.app-info h3 { font-size: 17px; }
.app-info .meta { color: var(--muted); font-size: 13px; margin: 4px 0; }
.app-info .intro { font-size: 13px; color: #5a5360; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app-actions { display: flex; gap: 10px; padding: 0 16px 16px; }
.app-actions .btn-primary, .app-actions .btn-outline { flex: 1; }
.app-reason { padding: 0 16px 16px; font-size: 13px; color: var(--primary-dark); }

/* 弹窗 / 表单 */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(43,34,51,.5); }
.modal-box { position: relative; background: #fff; border-radius: 18px; width: min(460px, 92%); max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); padding: 26px; }
.modal-close { position: absolute; top: 10px; right: 16px; background: none; border: none; font-size: 26px; color: var(--muted); cursor: pointer; }
.modal-body h2 { font-size: 20px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-body label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.modal-body input, .modal-body textarea, .modal-body select { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; font-family: inherit; }
.modal-body input:focus, .modal-body textarea:focus { outline: none; border-color: var(--primary); }
.modal-body textarea { resize: vertical; }
.modal-photo { margin-top: 10px; }
.modal-photo img { max-height: 120px; border-radius: 10px; }
.modal-actions { margin-top: 20px; display: flex; gap: 12px; }
.modal-actions .btn-primary { flex: 1; }

/* 设置 */
.settings-form { background: var(--card); padding: 26px; border-radius: var(--radius); max-width: 420px; border: 1px solid var(--line); }
.settings-form label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }
.settings-form input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; }
.settings-info { margin-top: 24px; color: var(--muted); font-size: 14px; line-height: 2; }
.settings-info code { background: #fff; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--primary-dark); }

@media (max-width: 720px) {
  .sidebar { width: 64px; }
  .side-logo, .side-foot span { display: none; }
  .nav-item { text-align: center; padding: 12px 4px; font-size: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 20px; }
}

/* ==================== 增强：工具栏 / 搜索 ==================== */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.search-input {
  flex: 1; min-width: 220px; max-width: 380px; padding: 11px 16px; font-size: 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,77,109,.1); }
.filter-tabs.inline { margin: 0; }

/* ==================== 增强：数据表 ==================== */
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #fffafb; }
.mini-photo { cursor: zoom-in; transition: transform .15s; }
.mini-photo:hover { transform: scale(1.08); }

/* ==================== 增强：概览卡片 ==================== */
.stat-card { transition: transform .2s ease, box-shadow .2s ease; position: relative; overflow: hidden; }
.stat-card:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(255,77,109,.16); }
.stat-card::after {
  content: "❤"; position: absolute; right: -8px; bottom: -16px; font-size: 62px;
  color: rgba(255,77,109,.07);
}
.stat-card .num { transition: color .2s; }
.stat-card:hover .num { color: var(--primary); }

/* ==================== 增强：侧栏 ==================== */
.nav-item { transition: all .18s ease; }
.sidebar { box-shadow: 2px 0 16px rgba(255,77,109,.05); }
.content { animation: panelIn .35s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==================== 增强：确认弹窗 ==================== */
.confirm-box { width: min(380px, 90%); }
.confirm-box h2 { font-size: 18px; margin-bottom: 10px; }
.confirm-text { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.confirm-input { margin-top: 10px; }

/* ==================== 增强：图片预览 ==================== */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(20,14,24,.9);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fadeIn .2s ease;
}
.lightbox[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox-close { position: absolute; top: 20px; right: 26px; background: none; border: none; color: #fff; font-size: 38px; cursor: pointer; line-height: 1; }

/* ==================== 宣传视频 / 媒体管理 ==================== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.media-card {
  background: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: 0 6px 18px rgba(0,0,0,.05); border: 1px solid var(--line);
}
.media-card h3 { font-size: 16px; margin-bottom: 14px; }
.media-preview { width: 100%; aspect-ratio: 1/1; background: #2b2233; border-radius: 14px; object-fit: cover; }
.media-audio { width: 100%; margin-bottom: 6px; }
.media-info { color: var(--muted); font-size: 13px; margin: 10px 0 14px; min-height: 18px; }
.upload-zone {
  border: 2px dashed var(--line); border-radius: 14px; padding: 22px 18px; text-align: center;
  cursor: pointer; transition: all .2s; background: #fffdfe;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone p { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.upload-zone span { color: var(--muted); font-size: 12px; }
.progress { height: 6px; background: var(--line); border-radius: 999px; margin-top: 12px; overflow: hidden; }
.progress[hidden] { display: none; }
.progress .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .25s; }
.media-remove { margin-top: 14px; }
.media-tips { margin-top: 22px; color: var(--muted); font-size: 13.5px; line-height: 2; }
.media-tips strong { color: var(--ink); }

/* ==================== 增强：消息提示 ==================== */
.toast-wrap { position: fixed; top: 22px; right: 22px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 220px; padding: 13px 18px; border-radius: 12px; color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 12px 30px rgba(0,0,0,.18); animation: toastIn .3s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.ok { background: linear-gradient(135deg, #2e9e5b, #43b872); }
.toast.err { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.toast.info { background: linear-gradient(135deg, #4a6cf7, #6f8cff); }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }


/* ==================== 修复：hidden 属性优先级 ==================== */
[hidden] { display: none !important; }
