:root {
  --brand: #2f7d5b;
  --brand-dark: #236046;
  --brand-light: #e9f5ef;
  --accent: #f0883e;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2933;
  --text-soft: #6b7785;
  --line: #eaeef2;
  --danger: #e54848;
  --shadow: 0 6px 20px rgba(31, 41, 51, 0.08);
  --radius: 16px;
  --safe-top: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #d7ece1 0%, #cfe0f0 100%);
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100%;
  display: flex;
  gap: 40px;
  align-items: center;
  justify-content: center;
  padding: 32px;
  flex-wrap: wrap;
}

/* ===== 手机设备外壳 ===== */
.device {
  width: 390px;
  height: 844px;
  background: #0e1116;
  border-radius: 46px;
  padding: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35), inset 0 0 0 2px #2a2f37;
  flex: 0 0 auto;
}
.app {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 状态栏 */
.status-bar {
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
}
.status-icons span { margin-left: 6px; font-size: 12px; }

/* 顶部标题栏 */
.app-header {
  background: var(--brand);
  color: #fff;
  padding-bottom: 14px;
  flex: 0 0 auto;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px 6px;
}
.campus { display: flex; align-items: center; gap: 10px; }
.campus-logo { font-size: 26px; }
.campus-text { display: flex; flex-direction: column; line-height: 1.25; }
.campus-text strong { font-size: 18px; }
.campus-text small { font-size: 11px; opacity: 0.82; }
.icon-btn {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}
.search-bar { padding: 8px 18px 0; }
.search-bar input {
  width: 100%;
  border: none;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.95);
  outline: none;
}

/* 主体滚动区 */
.app-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 14px 20px;
}
.app-body::-webkit-scrollbar { width: 0; }

/* 底部 Tab */
.tab-bar {
  flex: 0 0 auto;
  height: 60px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
}
.tab {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.2s;
}
.tab .tab-ico { font-size: 20px; filter: grayscale(1); opacity: 0.55; transition: 0.2s; }
.tab.active { color: var(--brand); font-weight: 600; }
.tab.active .tab-ico { filter: none; opacity: 1; transform: translateY(-1px); }

/* ===== 通用组件 ===== */
.page { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 4px 4px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title .more { font-size: 12px; color: var(--text-soft); font-weight: 400; }

.greeting { margin: 2px 4px 14px; }
.greeting h2 { margin: 0; font-size: 20px; }
.greeting p { margin: 4px 0 0; color: var(--text-soft); font-size: 13px; }

/* 快捷入口 */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.quick-ico {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--brand-light);
}
.quick-item span { font-size: 11px; color: var(--text-soft); }

/* 横幅轮播 */
.banner {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  position: relative;
  height: 120px;
  background: linear-gradient(120deg, var(--brand), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
}
.banner .b-text h3 { margin: 0 0 6px; font-size: 17px; }
.banner .b-text p { margin: 0; font-size: 12px; opacity: 0.9; }

/* 今日课程 */
.today-class {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.today-class:last-child { border-bottom: none; }
.tc-time { width: 52px; text-align: center; color: var(--brand); font-weight: 700; font-size: 13px; }
.tc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.tc-info { flex: 1; }
.tc-info strong { display: block; font-size: 14px; }
.tc-info small { color: var(--text-soft); font-size: 12px; }
.empty { color: var(--text-soft); font-size: 13px; text-align: center; padding: 18px 0; }

/* 通知列表 */
.notice {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.notice:last-child { border-bottom: none; }
.notice-tag {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  height: fit-content;
  background: var(--brand-light);
  color: var(--brand);
}
.notice-tag.hot { background: #fde8e8; color: var(--danger); }
.notice-tag.edu { background: #e7f0ff; color: #2b6cb0; }
.notice-body strong { display: block; font-size: 14px; line-height: 1.4; }
.notice-body p { margin: 4px 0 0; font-size: 12px; color: var(--text-soft); }
.notice-meta { font-size: 11px; color: #9aa5b1; margin-top: 4px; }

/* 课表 */
.week-tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.week-tabs button {
  flex: 0 0 auto;
  border: none;
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.week-tabs button.active { background: var(--brand); color: #fff; font-weight: 600; }
.sched-card {
  border-left: 4px solid var(--brand);
  background: var(--brand-light);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.sched-card .sc-top { display: flex; justify-content: space-between; align-items: center; }
.sched-card strong { font-size: 14px; }
.sched-card .sc-time { font-size: 12px; color: var(--brand-dark); font-weight: 600; }
.sched-card .sc-loc { font-size: 12px; color: var(--text-soft); margin-top: 4px; }

/* 失物招领 */
.lf-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.lf-filters button {
  border: none; background: #fff; border-radius: 16px; padding: 6px 14px;
  font-size: 12px; color: var(--text-soft); cursor: pointer; box-shadow: var(--shadow);
}
.lf-filters button.active { background: var(--brand); color: #fff; }
.lf-item {
  display: flex; gap: 12px; background: #fff; border-radius: 14px; padding: 12px;
  margin-bottom: 10px; box-shadow: var(--shadow);
}
.lf-emoji { font-size: 30px; flex: 0 0 auto; }
.lf-main { flex: 1; }
.lf-main strong { font-size: 14px; }
.lf-main p { margin: 4px 0; font-size: 12px; color: var(--text-soft); }
.lf-badge { font-size: 10px; padding: 2px 8px; border-radius: 8px; }
.lf-badge.lost { background: #fde8e8; color: var(--danger); }
.lf-badge.found { background: #e7f7ee; color: var(--brand); }
.float-btn {
  position: absolute; right: 18px; bottom: 78px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 26px; box-shadow: 0 8px 18px rgba(240, 136, 62, 0.45);
  cursor: pointer; z-index: 5;
}

/* 个人中心 */
.profile-head {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(120deg, var(--brand), var(--brand-dark));
  color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.avatar { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.profile-head .ph-name { font-size: 18px; font-weight: 700; }
.profile-head .ph-sub { font-size: 12px; opacity: 0.9; margin-top: 3px; }
.stat-row { display: flex; text-align: center; margin-top: 12px; }
.stat-row div { flex: 1; }
.stat-row strong { font-size: 17px; display: block; }
.stat-row small { font-size: 11px; opacity: 0.85; }

.menu-list { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px;
}
.menu-item:last-child { border-bottom: none; }
.menu-item .mi-ico { font-size: 18px; width: 24px; text-align: center; }
.menu-item .mi-arrow { margin-left: auto; color: #c2cbd4; }

/* 服务宫格（我的页面） */
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.service-cell {
  background: #fff; border-radius: 14px; padding: 14px 8px; text-align: center;
  box-shadow: var(--shadow); cursor: pointer; font-size: 12px; color: var(--text-soft);
}
.service-cell .sc-ico { font-size: 24px; display: block; margin-bottom: 6px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-mask[hidden] { display: none; }
.modal {
  width: 390px; max-width: 100%; background: #fff; border-radius: 20px 20px 0 0;
  padding: 20px; max-height: 80vh; overflow-y: auto; animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.modal h3 { margin: 0 0 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; outline: none; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 70px; }
.btn-primary {
  width: 100%; background: var(--brand); color: #fff; border: none;
  border-radius: 12px; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-ghost {
  width: 100%; background: #f1f3f5; color: var(--text-soft); border: none;
  border-radius: 12px; padding: 11px; font-size: 14px; cursor: pointer; margin-top: 8px;
}

/* 侧边介绍（桌面） */
.side-info { max-width: 360px; color: #1c2b22; }
.side-info h1 { font-size: 26px; margin: 0 0 12px; }
.side-info .lead { font-size: 14px; line-height: 1.6; color: #33453b; }
.side-info .feat { list-style: none; padding: 0; margin: 16px 0; }
.side-info .feat li { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed rgba(0,0,0,0.08); }
.side-info .hint { font-size: 12px; color: #4a5a50; background: rgba(255,255,255,0.5); padding: 12px; border-radius: 12px; }

/* ===== 移动端全屏适配 ===== */
@media (max-width: 720px) {
  body { background: var(--bg); }
  .stage { padding: 0; gap: 0; display: block; }
  .device { width: 100%; height: 100vh; border-radius: 0; padding: 0; box-shadow: none; }
  .app { border-radius: 0; }
  .side-info { display: none; }
  .modal-mask { align-items: stretch; }
  .modal { width: 100%; border-radius: 20px 20px 0 0; }
}
