* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f2f7;
  color: #1a1a1a;
  font-size: 15px;
  line-height: 1.5;
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
a { color: inherit; text-decoration: none; }
input, textarea { font-family: inherit; font-size: 15px; }

/* ===== 登录页 ===== */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: #f2f2f7;
  padding: 20px;
}
.login-box {
  width: 100%; max-width: 340px;
  text-align: center;
}
.login-logo { margin-bottom: 20px; }
.login-box h1 { font-size: 20px; font-weight: 600; margin-bottom: 28px; color: #1a1a1a; }
.login-box .form-group { margin-bottom: 12px; }
.login-box input {
  width: 100%; padding: 13px 14px;
  border: 1px solid #e0e0e0; border-radius: 10px;
  background: #fff; outline: none;
  -webkit-appearance: none;
}
.login-box input:focus { border-color: #576b95; }

/* ===== 通用按钮 ===== */
.btn-primary {
  padding: 12px 24px;
  background: #576b95; color: #fff;
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 500; cursor: pointer;
}
.btn-primary.block { width: 100%; }
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.5; }

.back-link { display: block; margin-top: 18px; color: #999; font-size: 13px; }

.err { color: #d33; font-size: 13px; min-height: 18px; margin: 8px 0; }

/* ===== 顶部栏 ===== */
.admin-nav {
  position: sticky; top: 0; z-index: 10;
  background: #fff; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #eee;
}
.admin-title { font-size: 17px; font-weight: 600; }
.nav-link { color: #576b95; font-size: 14px; }

/* ===== Tab 页 ===== */
.tab-page { display: none; padding-bottom: 80px; }
.tab-page.active { display: block; }
.pad { padding: 14px; }

.big-textarea {
  width: 100%; min-height: 120px; padding: 12px;
  border: 1px solid #e0e0e0; border-radius: 10px;
  background: #fff; outline: none; resize: vertical;
  -webkit-appearance: none;
}
.location-input {
  width: 100%; padding: 11px 12px; margin-top: 10px;
  border: 1px solid #e0e0e0; border-radius: 10px;
  background: #fff; outline: none; -webkit-appearance: none;
}

/* ===== 图片预览 ===== */
.img-preview {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-top: 10px;
}
.img-preview:empty { display: none; }
.img-preview .item {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
}
.img-preview .item img { width: 100%; height: 100%; object-fit: cover; }
.img-preview .item .del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
}

.upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; margin-top: 10px;
  border: 1px dashed #ccc; border-radius: 10px;
  color: #666; font-size: 14px; cursor: pointer;
  background: #fff;
}
.upload-row { display: flex; gap: 10px; }

/* 视频预览 */
.video-preview {
  position: relative; margin-top: 10px;
  border-radius: 10px; overflow: hidden;
  background: #000;
}
.video-preview video { width: 100%; max-height: 280px; display: block; }
.video-preview .del {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; z-index: 2;
}
.upload-progress {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6); color: #fff;
  padding: 6px; text-align: center; font-size: 13px;
}

/* ===== 我的页面 ===== */
.me-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  margin-bottom: 12px;
}
.me-cover {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #e5e5e5;
}
.me-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-edit {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* 多封面网格 */
.cover-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 10px 12px 0;
}
.cover-grid:empty { display: none; }
.cover-grid .item {
  position: relative; aspect-ratio: 16/10; border-radius: 6px; overflow: hidden;
}
.cover-grid .item img { width: 100%; height: 100%; object-fit: cover; }
.cover-grid .item .del {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer;
}
.cover-controls {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
}
.cover-controls .upload-btn { margin: 0; }

/* 数据统计 */
.stats-card {
  display: flex; justify-content: space-around;
  margin: 10px 12px; padding: 14px 0;
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-item { text-align: center; }
.stat-item b { display: block; font-size: 18px; color: #333; }
.stat-item span { font-size: 11px; color: #999; margin-top: 2px; display: block; }
.interval-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #666;
}
.interval-row input {
  width: 50px; padding: 6px; border: 1px solid #ddd; border-radius: 6px;
  text-align: center; -webkit-appearance: none;
}
.me-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
}
.me-avatar-box {
  position: relative; width: 56px; height: 56px;
  flex-shrink: 0;
}
.me-avatar-box img {
  width: 100%; height: 100%; border-radius: 8px; object-fit: cover;
  background: #eee;
}
.avatar-edit {
  position: absolute; bottom: -4px; right: -4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #576b95; color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid #fff;
}
.nickname-input {
  flex: 1; padding: 8px 10px;
  border: 1px solid #e0e0e0; border-radius: 8px;
  background: #fff; outline: none; -webkit-appearance: none;
  font-size: 16px; font-weight: 500;
}

/* ===== 列表 ===== */
.list-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  margin-bottom: 12px;
}
.list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f5f5f5; }
.list-item.danger { color: #d33; justify-content: center; }

/* ===== 子面板 ===== */
.sub-panel {
  background: #fff; border-radius: 12px; padding: 16px;
  margin-bottom: 12px; display: none;
}
.sub-panel.active { display: block; }
.sub-panel h3 { font-size: 16px; margin-bottom: 12px; }
.sub-panel input {
  width: 100%; padding: 11px 12px; margin-bottom: 10px;
  border: 1px solid #e0e0e0; border-radius: 8px;
  outline: none; -webkit-appearance: none;
}

/* ===== 动态列表 ===== */
.post-list .post-item {
  padding: 12px 0; border-bottom: 1px solid #f0f0f0;
}
.post-list .post-item:last-child { border-bottom: none; }
.post-list .content { font-size: 14px; margin-bottom: 6px; word-break: break-all; }
.post-list .imgs { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.post-list .imgs img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.post-list .imgs video { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; background: #000; }
.post-list .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.post-list .time { color: #999; font-size: 12px; }
.post-list .meta .ops { display: flex; gap: 6px; }
.btn-del {
  background: none; border: 1px solid #d33; color: #d33;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-edit, .btn-pin, .btn-save, .btn-cancel {
  background: none; border: 1px solid #576b95; color: #576b95;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.btn-pin { border-color: #fa9d3b; color: #fa9d3b; }
.btn-cancel { border-color: #bbb; color: #888; }
.btn-save { border-color: #07c160; color: #fff; background: #07c160; }
.post-list .post-item .pin-tag {
  display: inline-block; margin-bottom: 6px; padding: 1px 6px;
  font-size: 11px; color: #fa9d3b; border: 1px solid #fa9d3b; border-radius: 3px;
}
.post-list .edit-box { margin-top: 8px; }
.post-list .edit-box textarea,
.post-list .edit-box input {
  width: 100%; border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 6px 8px; font-size: 13px; margin-bottom: 6px; -webkit-appearance: none;
}
.post-list .edit-box .edit-ops { display: flex; gap: 8px; justify-content: flex-end; }
.loading { text-align: center; color: #999; padding: 20px 0; font-size: 14px; }

/* ===== 底部 Tab ===== */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-top: 1px solid #eee;
  display: flex; z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; padding: 8px 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #999; font-size: 11px; cursor: pointer;
}
.tab-item.active { color: #576b95; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75); color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 14px; z-index: 100;
  opacity: 0; transition: opacity 0.25s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }
