/* ============================================================
   通知发布网 · 主题与样式
   主题通过 <html data-theme="xxx"> 切换，变量集中在下方
   ============================================================ */

/* ---------- 1. 典雅国风（默认） ---------- */
:root,
[data-theme='ink'] {
  --bg: #f4efe4;
  --bg-deep: #ece4d4;
  --surface: #fffdf8;
  --surface-2: #f8f2e6;
  --text: #231f1a;
  --text-soft: #6d6355;
  --text-faint: #9a8f7e;
  --accent: #9e2b25;
  --accent-2: #b8622f;
  --accent-soft: rgba(158, 43, 37, 0.1);
  --border: #e0d5bf;
  --border-strong: #cdbfa2;
  --shadow: 0 8px 28px rgba(84, 62, 30, 0.12);
  --shadow-hover: 0 16px 40px rgba(84, 62, 30, 0.2);
  --radius: 14px;
  --radius-sm: 8px;
  --font-title: 'Songti SC', 'STSong', 'SimSun', 'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --hero-deco: rgba(158, 43, 37, 0.08);
  --pattern: rgba(158, 43, 37, 0.05);
  --cover-bg: linear-gradient(135deg, #efe6d3 0%, #e3d6bd 100%);
}

/* ---------- 2. 简约商务 ---------- */
[data-theme='business'] {
  --bg: #f4f6f9;
  --bg-deep: #e9edf3;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #16202e;
  --text-soft: #55617a;
  --text-faint: #8a94a6;
  --accent: #2563eb;
  --accent-2: #1e40af;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --shadow: 0 6px 22px rgba(15, 30, 60, 0.08);
  --shadow-hover: 0 14px 34px rgba(15, 30, 60, 0.16);
  --radius: 10px;
  --radius-sm: 6px;
  --font-title: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --hero-deco: rgba(37, 99, 235, 0.06);
  --pattern: rgba(37, 99, 235, 0.05);
  --cover-bg: linear-gradient(135deg, #e8eefb 0%, #dbe4f7 100%);
}

/* ---------- 3. 科技蓝紫 ---------- */
[data-theme='tech'] {
  --bg: #0d1220;
  --bg-deep: #080c16;
  --surface: #151d31;
  --surface-2: #1b243c;
  --text: #e9eefb;
  --text-soft: #a3b0cc;
  --text-faint: #6f7d9c;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --border: #26304b;
  --border-strong: #35426a;
  --shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 16px 40px rgba(124, 92, 255, 0.28);
  --radius: 14px;
  --radius-sm: 8px;
  --font-title: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --hero-deco: rgba(124, 92, 255, 0.16);
  --pattern: rgba(124, 92, 255, 0.08);
  --cover-bg: linear-gradient(135deg, #221a4a 0%, #14284a 100%);
}

/* ---------- 4. 明亮活泼 ---------- */
[data-theme='fresh'] {
  --bg: #fff8f0;
  --bg-deep: #ffefdf;
  --surface: #ffffff;
  --surface-2: #fff4e8;
  --text: #2b2119;
  --text-soft: #7a6552;
  --text-faint: #a9917a;
  --accent: #f2703a;
  --accent-2: #22c07d;
  --accent-soft: rgba(242, 112, 58, 0.12);
  --border: #f2e0cd;
  --border-strong: #e6cdb2;
  --shadow: 0 10px 26px rgba(214, 141, 74, 0.16);
  --shadow-hover: 0 18px 40px rgba(214, 141, 74, 0.26);
  --radius: 20px;
  --radius-sm: 12px;
  --font-title: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --hero-deco: rgba(242, 112, 58, 0.1);
  --pattern: rgba(242, 112, 58, 0.06);
  --cover-bg: linear-gradient(135deg, #ffe9d6 0%, #ffd9c2 100%);
}

/* ---------- 5. 夜墨（深色国风） ---------- */
[data-theme='night'] {
  --bg: #14171a;
  --bg-deep: #0e1013;
  --surface: #1c2126;
  --surface-2: #22282f;
  --text: #e9e4da;
  --text-soft: #a49c8e;
  --text-faint: #746d61;
  --accent: #c8503f;
  --accent-2: #d9a54a;
  --accent-soft: rgba(200, 80, 63, 0.16);
  --border: #2c333a;
  --border-strong: #3c454e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 18px 42px rgba(0, 0, 0, 0.62);
  --radius: 14px;
  --radius-sm: 8px;
  --font-title: 'Songti SC', 'STSong', 'SimSun', serif;
  --font-body: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --hero-deco: rgba(200, 80, 63, 0.12);
  --pattern: rgba(217, 165, 74, 0.06);
  --cover-bg: linear-gradient(135deg, #2a3037 0%, #1e232a 100%);
}

/* ============================ 基础 ============================ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  transition: background-color .35s ease, color .35s ease;
}

body::before {
  /* 纸纹 / 网格底纹 */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 12% 18%, var(--pattern) 0, transparent 45%),
    radial-gradient(circle at 88% 12%, var(--pattern) 0, transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 1;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* ============================ 顶栏 ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(160%) blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-seal {
  width: 40px; height: 40px;
  flex: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px var(--accent-soft);
}

.brand-text { min-width: 0; }
.brand-name {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-sub {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all .2s ease;
  color: var(--text-soft);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 13px;
  transition: all .2s ease;
  white-space: nowrap;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
.ghost-btn svg { width: 16px; height: 16px; }

/* ============================ 主题面板 ============================ */
.theme-panel {
  position: fixed;
  top: 64px;
  right: 20px;
  z-index: 60;
  width: 260px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: none;
}
.theme-panel.open { display: block; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.theme-panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 1px;
}
.theme-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13px;
  transition: all .18s ease;
}
.theme-item:hover { border-color: var(--accent); }
.theme-item.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft) inset; }
.theme-dot {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
}

/* ============================ Hero ============================ */
.hero {
  position: relative;
  padding: 46px 0 34px;
  text-align: center;
}
.hero::after {
  content: '';
  display: block;
  width: 120px;
  height: 1px;
  margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.hero-title {
  margin: 0;
  font-family: var(--font-title);
  font-size: clamp(26px, 6vw, 42px);
  letter-spacing: 6px;
  font-weight: 700;
  line-height: 1.35;
}
.hero-sub {
  margin: 12px auto 0;
  max-width: 560px;
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: 1px;
}
.hero-stats {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  color: var(--text-faint);
  font-size: 13px;
}
.hero-stats b {
  display: block;
  font-family: var(--font-title);
  font-size: 22px;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.4;
}

/* ============================ 搜索 / 筛选 ============================ */
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.search-box {
  flex: 1 1 240px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 14px;
  width: 17px; height: 17px;
  color: var(--text-faint);
}
.search-box input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
  transition: all .2s ease;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================ 通知列表 ============================ */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text-soft);
}
.section-title::before {
  content: '';
  width: 4px; height: 16px;
  border-radius: 2px;
  background: var(--accent);
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.notice-card {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}
.notice-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .25s ease;
}
.notice-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.notice-card:hover::before { opacity: 1; }

.card-cover {
  width: 116px;
  flex: none;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--cover-bg);
  display: grid;
  place-items: center;
  position: relative;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover .cover-fallback {
  font-family: var(--font-title);
  font-size: 34px;
  color: var(--accent);
  opacity: .55;
  letter-spacing: 2px;
}

.card-body { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-faint);
}
.tag {
  padding: 2px 9px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.6;
}
.tag.pinned { background: var(--accent); color: #fff; border-color: var(--accent); }
.card-title {
  margin: 8px 0 6px;
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notice-card:hover .card-title { color: var(--accent); }
.card-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.read-more {
  margin-left: auto;
  color: var(--accent);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.notice-card:hover .read-more { transform: translateX(3px); }
.read-more svg { width: 14px; height: 14px; transition: transform .2s ease; }

/* 置顶大卡 */
.notice-card.featured {
  grid-column: 1 / -1;
  background: linear-gradient(120deg, var(--surface) 0%, var(--surface-2) 100%);
}
.notice-card.featured .card-cover { width: 180px; }
.notice-card.featured .card-title { font-size: 21px; }

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.empty h3 { margin: 14px 0 6px; font-family: var(--font-title); color: var(--text); }
.empty p { margin: 0 0 18px; font-size: 13.5px; }

/* ============================ 页脚 ============================ */
.site-footer {
  margin-top: 48px;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
  letter-spacing: 1px;
}
.site-footer a { color: var(--accent); }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s ease;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-danger { background: transparent; color: #c0392b; border-color: #c0392b; }
.btn-danger:hover { background: rgba(192, 57, 43, .1); }

/* ============================ 管理端 ============================ */
.admin-wrap { max-width: 860px; }
.panel {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.panel h2 {
  margin: 0 0 4px;
  font-family: var(--font-title);
  font-size: 19px;
  letter-spacing: 2px;
}
.panel .hint { margin: 0 0 18px; color: var(--text-faint); font-size: 13px; }

.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-soft);
}
.field label .req { color: var(--accent); }
.field input[type='text'],
.field input[type='date'],
.field input[type='password'],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  outline: none;
  transition: all .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 78px; resize: vertical; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-soft); }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--accent); }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: all .2s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--accent); opacity: .8; }
.dropzone p { margin: 8px 0 2px; font-size: 14px; }
.dropzone small { color: var(--text-faint); font-size: 12.5px; }

.file-summary {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-soft);
}
.file-summary b { color: var(--text); }

.progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  display: none;
}
.progress.show { display: block; }
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}
.progress-text { margin-top: 6px; font-size: 12.5px; color: var(--text-faint); display: none; }
.progress-text.show { display: block; }

.manage-list { display: flex; flex-direction: column; gap: 12px; }
.manage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.manage-item .mi-main { min-width: 0; flex: 1; }
.manage-item .mi-title {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.manage-item .mi-sub { font-size: 12.5px; color: var(--text-faint); }
.manage-item .mi-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 14px;
  border: 1px solid;
}
.alert-error { background: rgba(192, 57, 43, .1); border-color: rgba(192, 57, 43, .35); color: #a5281c; }
.alert-ok { background: rgba(34, 160, 100, .1); border-color: rgba(34, 160, 100, .35); color: #1c7a51; }
.alert-warn { background: rgba(198, 138, 34, .12); border-color: rgba(198, 138, 34, .4); color: #8a5c12; }

.login-box { max-width: 400px; margin: 60px auto; text-align: center; }
.login-box .brand-seal { width: 56px; height: 56px; font-size: 22px; margin: 0 auto 14px; }

/* ============================ 响应式 ============================ */
@media (max-width: 720px) {
  .page { padding: 0 14px 48px; }
  .header-inner { padding: 10px 14px; gap: 10px; }
  .brand-seal { width: 34px; height: 34px; font-size: 15px; }
  .brand-name { font-size: 16px; letter-spacing: 1px; }
  .brand-sub { display: none; }
  .hero { padding: 30px 0 22px; }
  .hero-title { letter-spacing: 3px; }
  .notice-grid { grid-template-columns: 1fr; gap: 14px; }
  .notice-card { padding: 13px; gap: 12px; }
  .card-cover { width: 92px; }
  .card-title { font-size: 16.5px; -webkit-line-clamp: 2; }
  .card-summary { -webkit-line-clamp: 2; font-size: 13px; }
  .notice-card.featured { flex-direction: column; }
  .notice-card.featured .card-cover { width: 100%; aspect-ratio: 16 / 9; }
  .notice-card.featured .card-title { font-size: 18px; }
  .toolbar { gap: 10px; }
  .search-box { flex: 1 1 100%; }
  .filters { overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .chip { flex: none; }
  .theme-panel { right: 14px; left: 14px; width: auto; }
  .two-col { grid-template-columns: 1fr; }
  .manage-item { flex-direction: column; align-items: stretch; }
  .manage-item .mi-actions { justify-content: flex-end; }
  .panel { padding: 16px; }
}

@media (max-width: 380px) {
  .card-cover { width: 76px; }
  .hero-stats { gap: 16px; }
}
