/* ============================================================
   iOS 风格设计系统
   ============================================================ */
:root {
  /* 背景 / 表面 */
  --bg: #f2f2f7;              /* iOS systemGroupedBackground */
  --card: #ffffff;
  --card-2: #f9f9fb;
  --fill: #f2f2f7;            /* 输入框等填充 */
  --fill-2: #e9e9ee;

  /* 文字 */
  --text: #1c1c1e;           /* label */
  --text-2: #3c3c43;
  --muted: #8e8e93;          /* secondaryLabel */

  /* 强调色（iOS 系统色） */
  --blue: #007aff;
  --blue-dark: #0066d6;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;

  /* 平台色 */
  --xhs: #ff2442;
  --reddit: #ff4500;

  /* 分隔线 / 圆角 / 阴影 */
  --separator: rgba(60, 60, 67, 0.12);
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--blue); text-decoration: none; }
a:hover { opacity: .85; }

h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 22px; }
h3 { font-size: 17px; font-weight: 600; margin: 0 0 14px; }

/* ---------- 顶栏（毛玻璃导航栏） ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
  padding: 12px 22px;
  position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
.topbar nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.topbar nav a {
  color: var(--text); font-size: 14px; font-weight: 500;
  padding: 6px 12px; border-radius: 980px; transition: background .15s, color .15s;
}
.topbar nav a:hover { background: var(--fill); opacity: 1; }
.topbar nav a.active { background: var(--blue); color: #fff; }
.topbar nav a.muted { color: var(--muted); }

.container { max-width: 1000px; margin: 0 auto; padding: 26px 18px 80px; }
/* 宽屏页面（如概览）：减少两侧留白，给表格更大空间 */
.container.container-wide { max-width: 1440px; }

/* ---------- 卡片 / 表单 ---------- */
.card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow);
}
label {
  display: block; font-size: 13px; font-weight: 500; color: var(--muted);
  margin: 16px 0 7px;
}
input[type=text], input[type=password], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid transparent;
  background: var(--fill); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; color: var(--text);
  transition: border-color .15s, background .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none; background: #fff; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px; cursor: pointer;
}
input[type=file] {
  width: 100%; font-size: 14px; background: var(--fill);
  border-radius: var(--radius-sm); padding: 10px 12px; border: 1px dashed var(--separator);
}
input[type=file]::-webkit-file-upload-button {
  border: none; background: var(--fill-2); color: var(--text);
  padding: 7px 14px; border-radius: 8px; font-weight: 500; cursor: pointer; margin-right: 12px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: var(--fill-2); color: var(--text);
  padding: 11px 20px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 15px; font-weight: 600; font-family: inherit; line-height: 1;
  transition: transform .08s, opacity .15s, background .15s;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; font-weight: 600; border-radius: 9px; }
.btn.copied { background: var(--green); color: #fff; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- 提示 ---------- */
.flash {
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
  font-size: 14px; font-weight: 500;
}
.flash-ok { background: rgba(52, 199, 89, 0.14); color: #1f8c3b; }
.flash-error { background: rgba(255, 59, 48, 0.13); color: #c1271d; }
.muted { color: var(--muted); }

/* ---------- 概览统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 22px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-card .num { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; color: var(--blue); }
.stat-card div:last-child { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- 表格（卡片化，细分隔线） ---------- */
/* 横向滚动容器：手机端列放不下时左右滑动查看 */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 22px;
}
.table-wrap .table { box-shadow: none; }
.table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--card); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); white-space: nowrap;
}
.table th, .table td {
  padding: 14px 16px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--separator); vertical-align: middle;
}
.table th {
  background: var(--card-2); color: var(--muted); font-weight: 600;
  font-size: 12px; text-transform: none; letter-spacing: .02em;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--card-2); }
.table select { padding: 8px 30px 8px 12px; font-size: 13px; background-color: var(--fill); }

.row-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.filter { display: flex; gap: 8px; }

/* 标题两行省略 / 链接单行省略 */
.clamp2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; max-width: 260px; min-width: 140px;
  word-break: break-word; line-height: 1.4; white-space: normal;
}
.cell-link {
  display: inline-block; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}

/* 操作列 */
.ops { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ops form, .table form { margin: 0; }

/* ---------- 标签 / 徽章 ---------- */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 980px; font-size: 12px;
  font-weight: 600; color: #fff; background: var(--muted); white-space: nowrap;
}
.tag-xiaohongshu { background: var(--xhs); }
.tag-reddit { background: var(--reddit); }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 980px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-done { background: rgba(52, 199, 89, 0.16); color: #1f8c3b; }
.badge-pending { background: rgba(255, 149, 0, 0.16); color: #b86e00; }

/* ---------- 分配复选框 ---------- */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 6px; }
.check-item {
  display: flex; align-items: center; gap: 8px; padding: 12px;
  background: var(--fill); border-radius: var(--radius-sm); margin: 0;
}
.check-item input { width: auto; }

/* ---------- 居中页（登录） ---------- */
.center-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; padding: 30px 26px; }
.auth-card h1 { text-align: center; margin-bottom: 8px; }
.auth-card .btn { width: 100%; margin-top: 22px; padding: 13px; }

/* ---------- 分段控件式空间切换（设备端） ---------- */
.space-menu {
  display: flex; gap: 2px; background: var(--fill-2); padding: 3px;
  border-radius: 12px; max-width: 440px; margin: 16px auto 0;
}
.space-tab {
  flex: 1; text-align: center; padding: 8px 16px; border-radius: 9px;
  color: var(--text); font-size: 14px; font-weight: 600; transition: background .15s, box-shadow .15s;
}
.space-tab:hover { opacity: 1; }
.space-tab.active { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); color: var(--text); }

/* ---------- 前台帖子卡片 ---------- */
.post-card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.post-card.is-done { opacity: .92; }
.post-head { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }

.field { margin-top: 16px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
/* 字段头部：标题在左，复制按钮对齐右上 */
.field-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; gap: 10px;
}
.field-head .field-label { margin-bottom: 0; }
.field-row { display: flex; gap: 10px; align-items: flex-start; }
.field-value {
  flex: 1; background: var(--fill); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 15px; min-height: 22px; word-break: break-word;
}
.field-value.pre { white-space: pre-wrap; }
.copy-btn { flex-shrink: 0; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.media-item {
  background: var(--fill); border-radius: var(--radius); padding: 10px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.media-item img, .media-item video { width: 100%; border-radius: 10px; max-height: 190px; object-fit: cover; }

.task-action {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--separator);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.complete-form { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.complete-form input { flex: 1; min-width: 200px; }
.done-info { flex: 1; font-size: 14px; word-break: break-all; color: var(--text-2); }

/* ---------- 响应式 ---------- */
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  h1 { font-size: 23px; }
  .container { padding: 20px 14px 70px; }
  .topbar { padding: 11px 16px; }
}
