/* ============================================================
   二创拍摄任务 · 移动端详情页样式
   设计基调：暖白底 + 墨色文字 + 橙色行动提示，微信内直接浏览
   ============================================================ */

:root {
  --bg: #f5f2ec;
  --card: #ffffff;
  --ink: #191714;
  --ink-2: #6c665d;
  --ink-3: #9a938a;
  --line: rgba(25, 23, 20, 0.07);
  --accent: #f26b2a;
  --accent-deep: #dd5317;
  --accent-soft: #fff1e8;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(60, 44, 30, 0.08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 55% at 50% 0%, rgba(255, 211, 173, 0.35), transparent 62%),
    radial-gradient(80% 40% at 100% 100%, rgba(255, 236, 221, 0.5), transparent 60%);
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app {
  max-width: 520px;
  margin: 0 auto;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  background: linear-gradient(
    to bottom,
    rgba(245, 242, 236, 0.97),
    rgba(245, 242, 236, 0.82)
  );
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

body.scrolled .topbar {
  border-bottom-color: var(--line);
}

.icon-btn {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(60, 44, 30, 0.06);
}

.topbar-title {
  flex: 1;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-count {
  flex: none;
  padding-right: 6px;
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

/* ---------------- 素材详情：参考图 ---------------- */

.detail {
  padding: 8px 18px calc(132px + var(--safe-b));
}

.hero {
  margin-top: 4px;
}

.hero-img {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-top: 133.33%; /* 3:4，兼容老版本 WebView */
  overflow: hidden;
  border-radius: 24px;
  background: #e9e2d8;
  box-shadow: 0 18px 40px rgba(60, 44, 30, 0.16);
}

.hero-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-img::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 96px;
  background: linear-gradient(to top, rgba(20, 15, 10, 0.34), transparent);
  pointer-events: none;
}

.hero-tag,
.hero-zoom {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero-tag {
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.hero-zoom {
  right: 14px;
  bottom: 12px;
  padding: 4px 10px;
  background: rgba(20, 15, 10, 0.4);
  color: #fff;
  font-weight: 500;
}

/* ---------------- 标题区 ---------------- */

.head {
  padding: 18px 2px 2px;
}

.head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chip-sm {
  height: 21px;
  padding: 0 8px;
  font-size: 10.5px;
}

.head-no {
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.head-title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

/* ---------------- 区块 ---------------- */

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.section-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.section-hint {
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ---------------- 拍摄要点 ---------------- */

.points {
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  list-style: none;
}

.point {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 15px 16px;
}

.point + .point::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  background: var(--line);
}

.point-no {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.point p {
  margin: 0;
  color: #3a3630;
  font-size: 14.5px;
  line-height: 1.65;
}

/* ---------------- 发布文案 ---------------- */

.text-btn {
  padding: 4px 0;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}

.copy-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.copy-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 14px 16px;
}

.copy-row + .copy-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  left: 16px;
  height: 1px;
  background: var(--line);
}

.copy-label {
  padding-top: 3px;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.copy-value {
  margin: 0;
  color: #26231f;
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.copy-value .muted {
  color: var(--ink-3);
}

.copy-btn {
  min-width: 48px;
  margin-top: 1px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #faf8f4;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.copy-btn:active {
  background: var(--accent-soft);
  border-color: rgba(242, 107, 42, 0.3);
  color: var(--accent-deep);
}

.copy-btn.done {
  border-color: rgba(242, 107, 42, 0.35);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

/* ---------------- 底部橙色提示条 ---------------- */

.tipbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: 100%;
  max-width: 520px;
  padding: 14px 20px calc(14px + var(--safe-b));
  border-radius: 20px 20px 0 0;
  background: linear-gradient(135deg, #ff7a33, #f0561b);
  color: #fff;
  box-shadow: 0 -10px 30px rgba(240, 86, 27, 0.24);
  transform: translateX(-50%);
}

.tipbar[hidden] {
  display: none;
}

.tipbar-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.tipbar-text {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
}

/* ---------------- 放大查看 ---------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 13, 11, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.no-scroll {
  overflow: hidden;
}

/* ---------------- 轻提示 ---------------- */

.toast {
  position: fixed;
  bottom: calc(96px + var(--safe-b));
  left: 50%;
  z-index: 90;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(25, 23, 20, 0.9);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- 素材库列表 ---------------- */

.list-wrap {
  padding: 0 18px 48px;
}

.list-head {
  padding: calc(30px + var(--safe-t)) 2px 4px;
}

.eyebrow {
  color: var(--accent-deep);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.list-head h1 {
  margin: 8px 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.list-sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card:active {
  opacity: 0.82;
}

.card-cover {
  position: relative;
  flex: none;
  width: 86px;
  height: 108px;
  overflow: hidden;
  border-radius: 14px;
  background: #e9e2d8;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-no {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-body h2 {
  margin: 8px 0 6px;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.45;
}

.card-meta {
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
}

.card-arrow {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f3efe8;
  color: var(--ink-2);
}

.list-foot {
  margin: 26px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.empty {
  padding: 60px 0;
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
}

/* ---------------- 入场动画 ---------------- */

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .toast,
  .lightbox,
  .copy-btn {
    transition: none;
  }
}

/* ---------------- 宽屏兜底 ---------------- */

@media (min-width: 560px) {
  body {
    padding-top: 8px;
  }

  .tipbar {
    bottom: 8px;
    border-radius: 20px;
  }

  .detail {
    padding-bottom: calc(140px + var(--safe-b));
  }
}

/* ============================================================
   v2 追加：按钮体系 / 素材库操作 / 登录页 / 管理后台
   ============================================================ */

/* ---------------- 通用按钮 ---------------- */

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a33, #f0561b);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(240, 86, 27, 0.28);
}

.btn-accent:active {
  opacity: 0.85;
}

.btn-accent[disabled] {
  opacity: 0.6;
}

.btn-lg {
  padding: 13px 20px;
  font-size: 15px;
  border-radius: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border: 1.5px solid rgba(25, 23, 20, 0.14);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}

.btn-outline:active {
  background: #faf8f4;
}

.btn-danger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(201, 59, 49, 0.08);
  color: #c93b31;
  font-size: 14px;
  font-weight: 600;
}

.btn-danger:active {
  background: rgba(201, 59, 49, 0.14);
}

/* ---------------- 素材库：头部与标签页 ---------------- */

.list-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.user-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 12.5px;
}

.user-name {
  overflow: hidden;
  max-width: 130px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 6px;
  width: max-content;
  margin-top: 16px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.tab {
  padding: 7px 22px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  transition: color 0.18s ease;
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

/* ---------------- 素材库：卡片操作行（覆盖 v1 卡片布局） ---------------- */

.card {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.card-main {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.card-ops {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.op-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 12px;
  background: #f6f2ea;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.op-btn:active {
  background: #efe9df;
}

.op-btn.danger {
  background: rgba(201, 59, 49, 0.08);
  color: #c93b31;
}

.op-btn.accent {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.empty-card {
  margin-top: 26px;
  padding: 34px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  text-align: center;
}

.empty-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.login-guide {
  margin-top: 26px;
  padding: 34px 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-guide h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.login-guide p {
  margin: 0 0 22px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ---------------- 素材库：管理员升级入口 ---------------- */

.upgrade-row {
  margin-top: 20px;
  text-align: center;
}

.upgrade-toggle {
  color: var(--ink-3);
  font-size: 12px;
  text-decoration: underline dotted;
}

.upgrade-form {
  display: none;
  gap: 8px;
  justify-content: center;
}

.upgrade-row.open .upgrade-form {
  display: inline-flex;
}

.upgrade-row.open .upgrade-toggle {
  display: none;
}

.upgrade-form input {
  width: 190px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}

.upgrade-form input:focus {
  border-color: rgba(242, 107, 42, 0.5);
}

.upgrade-form .op-btn {
  flex: none;
  width: auto;
  padding: 8px 16px;
}

/* ---------------- 登录页 ---------------- */

.login-wrap {
  padding: 0 22px 48px;
}

.login-card {
  margin-top: 26px;
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card .btn-accent svg {
  flex: none;
}

.login-or {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
  color: var(--ink-3);
  font-size: 12px;
}

.login-or::before,
.login-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-dev input {
  width: 100%;
  margin-bottom: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf8f4;
  color: var(--ink);
  font-size: 15px;
  outline: none;
}

.login-dev input:focus {
  border-color: rgba(242, 107, 42, 0.5);
  background: #fff;
}

.login-hint {
  margin: 18px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

/* ---------------- 管理后台：表单 ---------------- */

.admin-wrap {
  padding: 10px 18px calc(44px + var(--safe-b));
}

.field {
  margin-top: 22px;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.field-label .req {
  margin-left: 6px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.18s ease;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(242, 107, 42, 0.55);
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

/* ---------------- 管理后台：图片上传 ---------------- */

.upload {
  position: relative;
  display: flex;
  min-height: 200px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1.5px dashed rgba(25, 23, 20, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.upload:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.upload.has-img {
  border: none;
  background: #e9e2d8;
}

.upload.has-img::after {
  content: "点击更换";
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(20, 15, 10, 0.42);
  color: #fff;
  font-size: 11px;
}

.upload img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.upload-hint {
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
  line-height: 1.9;
}

.upload-hint span {
  font-size: 11.5px;
}

/* ---------------- 管理后台：保存结果 ---------------- */

.saved-box {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid rgba(242, 107, 42, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 122, 51, 0.1), rgba(255, 241, 232, 0.9));
}

.saved-title {
  margin: 0 0 12px;
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 700;
}

.saved-row {
  display: flex;
  gap: 10px;
}

.saved-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
}

.saved-row .btn-accent {
  flex: none;
  padding: 9px 16px;
  font-size: 13px;
}

.saved-box .btn-outline {
  margin-top: 12px;
  padding: 10px;
  font-size: 13.5px;
}

.saved-hint {
  margin: 12px 0 0;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.form-actions {
  margin-top: 30px;
}
