/* ============================================
   移动端仿APP自媒体工作台 — 天青色主题
   ============================================ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

:root {
  --cyan: #0da6ba;
  --cyan-light: #e0f7fa;
  --cyan-dark: #0891a0;
  --red: #e53935;
  --green: #43a047;
  --bg: #f3f4f8;
  --card: #ffffff;
  --text: #1a1a2e;
  --text2: #757586;
  --text3: #9e9e9e;
  --border: #eceef2;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 14px;
  --sidebar-w: 60px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #e2e5ed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ===== 手机容器 ===== */
.app-wrap {
  display: flex; justify-content: center; min-height: 100vh;
}
.app-container {
  width: 100%; max-width: 430px; display: flex;
  background: var(--bg); min-height: 100vh; position: relative;
}

/* ===== 左侧导航栏 ===== */
.sidebar {
  width: var(--sidebar-w); background: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 10px; gap: 3px;
  border-right: 1px solid var(--border); flex-shrink: 0;
  overflow-y: auto; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 50px; min-height: 50px; border-radius: 12px; padding: 5px 0;
  text-decoration: none; color: var(--text2); cursor: pointer;
  transition: all .18s; gap: 2px; -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 21px; height: 21px; flex-shrink: 0; }
.nav-item span { font-size: 10px; font-weight: 500; line-height: 1; white-space: nowrap; }
.nav-item:hover { color: var(--cyan); }
.nav-item.active { background: var(--cyan-light); color: var(--cyan-dark); }
.nav-item.active svg { stroke: var(--cyan-dark); }

/* ===== 主内容区 ===== */
.main-content {
  flex: 1; min-width: 0; overflow-y: auto; height: 100vh; padding-bottom: 24px;
}
.page { display: none; padding: 14px 14px 24px; }
.page.active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:translateY(0); }
}
.page-header { margin-bottom: 14px; }
.page-header h2 { font-size: 19px; font-weight: 700; }

/* ===== 通用卡片 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px;
  border: 1px solid var(--border);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 700; }

/* ===== 排名列表 ===== */
.rank-card { padding: 16px; }
.rank-list { display: flex; flex-direction: column; }
.rank-item {
  display: flex; align-items: center; padding: 11px 0; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-num {
  width: 24px; height: 24px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text2); background: var(--bg);
}
.rank-item:first-child .rank-num { background: var(--cyan-light); color: var(--cyan-dark); }
.rank-name {
  flex: 1; font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rank-value { font-size: 14px; font-weight: 700; min-width: 56px; text-align: right; }
.rank-value.up   { color: var(--red); }
.rank-value.down { color: var(--green); }
.rank-info { flex: 1; min-width: 0; }
.rank-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }

/* ===== 按钮 ===== */
.btn-sm {
  padding: 5px 14px; border-radius: 16px;
  border: 1px solid var(--cyan); background: #fff;
  color: var(--cyan-dark); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.btn-sm:hover, .btn-sm:active { background: var(--cyan); color: #fff; }

.btn-primary {
  padding: 9px 20px; border-radius: 10px; border: none;
  background: var(--cyan); color: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn-primary:hover, .btn-primary:active { background: var(--cyan-dark); }
.btn-full { width: 100%; padding: 11px; text-align: center; }
.btn-outline {
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff;
  color: var(--text2); font-size: 12px; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.btn-outline.danger { border-color: #ffcdd2; color: var(--red); }
.btn-outline.danger:hover { background: #ffebee; }

/* ===== 输入框 ===== */
.input, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: var(--bg); font-family: inherit;
  transition: border .15s; outline: none;
}
.input:focus, .textarea:focus { border-color: var(--cyan); }
.textarea { resize: vertical; min-height: 60px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.inline-row { display: flex; gap: 8px; margin-bottom: 10px; }
.f1 { flex: 1; }

/* ===== 弹窗 ===== */
.modal-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 100;
  justify-content: center; align-items: flex-end;
}
.modal-mask.show { display: flex; }
.modal-sheet {
  width: 100%; max-width: 430px; max-height: 78vh; overflow-y: auto;
  background: #fff; border-radius: 20px 20px 0 0;
  padding: 16px 16px 24px; animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 700; margin-bottom: 14px;
}
.modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--bg); font-size: 13px;
  color: var(--text2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-sheet .input { margin-bottom: 10px; }
.modal-sheet .btn-primary { margin-top: 4px; }
.modal-list { margin-top: 16px; }
.modal-list .rank-item { cursor: pointer; }
.modal-list .rank-item:hover { background: var(--bg); border-radius: 8px; padding-left: 6px; padding-right: 6px; }

/* ===== 主页 ===== */
.welcome-card {
  background: linear-gradient(135deg, var(--cyan-light), #e8f4f8);
  border: none; text-align: center; padding: 22px 16px;
}
.welcome-card h2 { font-size: 20px; font-weight: 700; margin: 4px 0 6px; }
.today-label { font-size: 12px; color: var(--text2); }
.welcome-sub { font-size: 13px; color: var(--text2); }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card {
  display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 14px;
}
.quick-icon {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.quick-info { display: flex; flex-direction: column; gap: 2px; }
.quick-title { font-size: 13px; font-weight: 700; }
.quick-sub { font-size: 11px; color: var(--text3); }

/* ===== 新闻卡片 ===== */
.news-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: none; }
.news-item h4 { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.news-item p { font-size: 12px; color: var(--text2); line-height: 1.5; }
.news-meta { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ===== 卡片网格 ===== */
.card-grid { display: flex; flex-direction: column; gap: 10px; }
.tip-card .icon { font-size: 28px; margin-bottom: 8px; }
.tip-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.tip-card p { font-size: 12px; color: var(--text2); line-height: 1.5; }
.tip-tags { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.tip-tags span {
  padding: 2px 8px; border-radius: 8px; font-size: 10px;
  background: var(--bg); color: var(--text2); font-weight: 500;
}

/* ===== 自律生活 ===== */
.habit-tracker { display: flex; flex-direction: column; gap: 10px; }
.habit-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.habit-row:last-child { border-bottom: none; }
.habit-check {
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; background: #fff;
}
.habit-check.done { background: var(--cyan); border-color: var(--cyan); }
.habit-check.done::after {
  content: ''; width: 6px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg); margin-top: -2px;
}
.habit-info { flex: 1; min-width: 0; }
.habit-info .name { font-size: 14px; font-weight: 600; display: block; }
.habit-info .streak { font-size: 11px; color: var(--text3); }
.habit-days { display: flex; gap: 4px; flex-shrink: 0; }
.habit-dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--bg); display: flex; align-items: center;
  justify-content: center; font-size: 9px; color: var(--text3);
  border: 1px solid var(--border);
}
.habit-dot.done { background: var(--cyan-light); border-color: var(--cyan-light); color: var(--cyan-dark); }
.habit-dot.today { border-color: var(--cyan); border-width: 2px; }

/* ===== 工作流程 ===== */
.wf-entry {
  display: flex; gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--border); align-items: flex-start;
}
.wf-entry:last-child { border-bottom: none; }
.wf-time { font-size: 12px; font-weight: 700; color: var(--cyan-dark); white-space: nowrap; }
.wf-body { flex: 1; min-width: 0; }
.wf-content { font-size: 13px; font-weight: 600; }
.wf-notes { font-size: 11px; color: var(--text3); margin-top: 2px; }
.wf-del {
  font-size: 14px; color: var(--text3); cursor: pointer; flex-shrink: 0;
  padding: 2px 6px; border-radius: 4px;
}
.wf-del:hover { color: var(--red); background: #ffebee; }

/* ===== 待办清单 ===== */
.todo-input-card { margin-bottom: 10px; }
.todo-stats-card { padding: 14px 16px; }
.stats-row { display: flex; justify-content: space-around; text-align: center; margin-bottom: 12px; }
.stat-item .stat-val { font-size: 22px; font-weight: 800; }
.stat-item .stat-lbl { font-size: 11px; color: var(--text3); }
.progress-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--cyan), var(--cyan-dark));
  border-radius: 3px; transition: width .35s ease; width: 0%;
}
.filter-row { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tag {
  padding: 5px 14px; border-radius: 16px;
  border: 1px solid var(--border); background: #fff;
  font-size: 12px; color: var(--text2); cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.tag.active { background: var(--cyan); color: #fff; border-color: var(--cyan); }
.todo-sec { display: flex; flex-direction: column; gap: 6px; }
.todo-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: var(--bg);
}
.todo-check2 {
  width: 22px; height: 22px; border-radius: 8px;
  border: 2px solid var(--border); flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #fff; transition: all .15s;
}
.todo-check2.done { background: var(--cyan); border-color: var(--cyan); }
.todo-check2.done::after {
  content: ''; width: 5px; height: 9px; border: solid #fff;
  border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px;
}
.todo-txt { flex: 1; font-size: 13px; font-weight: 500; transition: all .2s; }
.todo-txt.done { text-decoration: line-through; color: var(--text3); }
.todo-del {
  color: var(--text3); cursor: pointer; font-size: 16px; padding: 2px 6px;
  border-radius: 4px; opacity: 0; transition: all .15s;
}
.todo-row:hover .todo-del { opacity: 1; }
.todo-del:hover { color: var(--red); background: #ffebee; }
.todo-pri {
  padding: 2px 8px; border-radius: 8px; font-size: 10px; font-weight: 600;
}
.todo-pri.high { background: #ffebee; color: var(--red); }
.todo-pri.med  { background: #fff3e0; color: #f57c00; }
.todo-pri.low  { background: #e8f5e9; color: var(--green); }
.todo-cat {
  padding: 2px 6px; border-radius: 6px; font-size: 10px;
  background: var(--cyan-light); color: var(--cyan-dark);
}

/* ===== 萱萱日常 — 照片网格 ===== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-card {
  border-radius: 12px; overflow: hidden; position: relative;
  aspect-ratio: 1; background: var(--bg);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .15s;
}
.photo-card:hover { transform: scale(1.03); }
.photo-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-card .photo-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; font-size: 11px; padding: 20px 8px 6px;
  text-align: center; font-weight: 500;
}
.photo-card .photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,.4); color: #fff; border: none;
  font-size: 12px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.photo-card:hover .photo-del { opacity: 1; }
.photo-card .photo-cat-badge {
  position: absolute; top: 4px; left: 4px;
  padding: 2px 8px; border-radius: 8px;
  background: rgba(0,0,0,.4); color: #fff;
  font-size: 10px; font-weight: 500;
}

/* 照片上传弹窗 */
.photo-preview {
  width: 100%; min-height: 160px; border-radius: 12px;
  background: var(--bg); margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 2px dashed var(--border);
}
.photo-preview img {
  width: 100%; max-height: 300px; object-fit: contain;
}
.photo-preview .placeholder {
  color: var(--text3); font-size: 13px;
}
.upload-btn {
  display: block; text-align: center; padding: 12px;
  background: var(--cyan-light); color: var(--cyan-dark);
  border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-bottom: 10px;
}

/* 大图浏览 */
#lightbox { align-items: center; background: rgba(0,0,0,.85); }
#lightbox img {
  max-width: 92%; max-height: 85vh; border-radius: 8px; object-fit: contain;
}

/* 空状态 */
.empty { text-align: center; padding: 28px 16px; color: var(--text3); font-size: 13px; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd0d6; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #a8a9b0; }

/* ===== 防宽屏错乱 ===== */
@media (min-width: 431px) {
  .app-wrap { background: #e2e5ed; }
  .app-container { box-shadow: 0 0 60px rgba(0,0,0,.12); }
}
