:root {
  --bg: #fdfaf6;
  --bg-soft: #f6efe7;
  --card: #ffffff;
  --ink: #2b2622;
  --ink-soft: #6f655c;
  --line: #ece2d6;
  --accent: #b8726a;
  --accent-dark: #9c5a53;
  --gold: #c9a227;
  --ok: #4b8b5a;
  --err: #c0533f;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(96, 72, 52, 0.08);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.wrap-wide {
  max-width: 1200px;
}

/* ── 头部 ─────────────────────────────── */
.hero {
  text-align: center;
  padding: 20px 0 14px;
}

.hero .ornament {
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 8px;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: 26px;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: 2px;
}

.hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

/* 首屏就能看到的相册入口 */
.hero-link {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(184, 114, 106, 0.1);
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.hero-link:active {
  background: rgba(184, 114, 106, 0.22);
}

/* ── 卡片 ─────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 16px;
  margin: 0 0 12px;
  font-weight: 600;
}

/* ── 表单 ─────────────────────────────── */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input[type='text'],
input[type='password'] {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}

input[type='text']:focus,
input[type='password']:focus {
  border-color: var(--accent);
  background: #fff;
}

/* ── 按钮 ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.985);
  background: var(--accent-dark);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-ghost:active {
  background: rgba(184, 114, 106, 0.08);
}

.btn-sm {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}

/* ── 上传按钮（大块） ─────────────────── */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.dropzone:active {
  border-color: var(--accent);
  background: #fff;
}

.dropzone .icon {
  font-size: 34px;
}

.dropzone .title {
  font-size: 17px;
  font-weight: 600;
}

.dropzone .hint {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ── 开关 ─────────────────────────────── */
.toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
}

.toggle input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

/* ── 队列 ─────────────────────────────── */
.queue {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.queue li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.queue li:last-child {
  border-bottom: none;
}

.queue .thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-soft);
}

.queue .meta {
  flex: 1;
  min-width: 0;
}

.queue .name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue .state {
  font-size: 12px;
  color: var(--ink-soft);
}

.queue .state.ok {
  color: var(--ok);
}

.queue .state.err {
  color: var(--err);
}

.bar {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
  margin-top: 6px;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s;
}

/* 队列里的删除按钮 */
.queue .act {
  flex: 0 0 auto;
}

.row-del {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}

.row-del:active {
  background: #fbeeeb;
  color: var(--err);
  border-color: #f0cdc6;
}

/* 相册排序 */
.sortbar {
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

/* ── 提示条 ───────────────────────────── */
.notice {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.notice-info {
  background: #f3f7fb;
  color: #3a5673;
}

.notice-warn {
  background: #fdf5e6;
  color: #8a6a20;
}

.notice-err {
  background: #fbeeeb;
  color: var(--err);
}

.notice-ok {
  background: #eef6ef;
  color: var(--ok);
}

/* ── 相册网格 ─────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  padding-bottom: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
}

.tile img {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile .fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink-soft);
}

.tile .fill.broken {
  background: var(--bg-soft);
  color: #b2a596;
  flex-direction: column;
  gap: 4px;
}

.tile .badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
}

.tile .who {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 11px;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile.hidden-item {
  opacity: 0.4;
}

.tile .actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
}

.tile .actions button {
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
}

/* ── 后台多选 ─────────────────────────── */
.tile .pick {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.tile.selected .pick {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tile.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ── 点赞（透明大拇指） ─────────────── */
.tile .like {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: none;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.15;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, transform 0.12s, background 0.15s;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.tile .like.on {
  opacity: 1;
  color: #fff;
  background: rgba(184, 114, 106, 0.85);
}

.tile .like:active {
  transform: scale(0.88);
}

.tile .like .cnt {
  font-size: 11px;
  font-weight: 600;
}

/* ── 查看器 ───────────────────────────── */
.viewer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 16, 14, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.viewer.open {
  display: flex;
}

.viewer img,
.viewer video {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 8px;
}

.viewer .close {
  position: absolute;
  top: 16px;
  right: 18px;
  color: #fff;
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  z-index: 2;
}

.viewer-msg {
  color: #fff;
  text-align: center;
  font-size: 16px;
  line-height: 1.8;
  padding: 24px;
}

.viewer-msg .sub {
  opacity: 0.65;
  font-size: 13px;
  margin-top: 8px;
}

.viewer-actions {
  position: absolute;
  bottom: 26px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

.viewer-del {
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.viewer-del:active {
  background: rgba(192, 83, 63, 0.9);
  border-color: rgba(192, 83, 63, 0.9);
}

/* ── 大屏 ─────────────────────────────── */
.screen-body {
  background: #0d0b0a;
  overflow: hidden;
  height: 100vh;
}

.screen-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-stage img,
.screen-stage video {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: fade 0.8s ease;
}

.screen-foot {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 15px;
  letter-spacing: 2px;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── 工具类 ───────────────────────────── */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.between {
  justify-content: space-between;
}

.muted {
  color: var(--ink-soft);
  font-size: 13px;
}

.center {
  text-align: center;
}

.mt-12 {
  margin-top: 12px;
}

.mt-20 {
  margin-top: 20px;
}

.hidden {
  display: none !important;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 480px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  .hero h1 {
    font-size: 22px;
  }
}
