/* ============================================================
   Lucent · 灵感台 · 落日与灯火
   壁纸是 body 的背景图（遮罩已烤进图片），画面分两层：
   外壳（顶栏 + 名片区）站在照片上——浅字、深玻璃；
   卡片浮在画面中——浅玻璃、深字。
   ============================================================ */

:root {
  --brand-1: #5a6cff;
  --brand-2: #ff7a6b;

  --accent: var(--aira-accent, #e8452a);
  --on-accent: var(--aira-on-accent, #ffffff);

  /* 卡片：浅玻璃 + 深字 */
  --ink: #16181f;
  --ink-2: rgba(22, 24, 31, 0.62);
  --ink-3: rgba(22, 24, 31, 0.44);
  --ink-4: rgba(22, 24, 31, 0.2);

  /* 外壳：照片上的浅字与深玻璃 */
  --shell-ink: #f8f9fd;
  --shell-ink-2: rgba(248, 249, 253, 0.74);
  --shell-ink-3: rgba(248, 249, 253, 0.5);
  --shell-glass: rgba(16, 18, 28, 0.28);
  --shell-glass-2: rgba(16, 18, 28, 0.4);
  --shell-line: rgba(255, 255, 255, 0.2);
  --shell-top: rgba(255, 255, 255, 0.18);
  --shell-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);

  --page: #0e1017;

  --glass: rgba(255, 255, 255, 0.3);
  --glass-2: rgba(255, 255, 255, 0.56);
  --glass-3: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.62);
  --glass-top: rgba(255, 255, 255, 0.85);
  --glass-deep: 0 26px 64px rgba(6, 10, 24, 0.34);
  --glass-soft: 0 10px 26px rgba(6, 10, 24, 0.12);
  --blur-lg: blur(30px) saturate(190%);
  --blur-md: blur(18px) saturate(170%);
  --blur-sm: blur(12px) saturate(150%);

  /* The MatePad's own typefaces: HarmonyOS Sans for everything, Noto Sans Mono for figures. A computer
     without them gets the web edition's copies (src/fonts, scripts/web-fonts.py), never PingFang or Songti. */
  --sans: "HarmonyOS Sans SC", "HarmonyOS Sans", "Lucent Sans", system-ui, -apple-system, "PingFang SC",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
  /* If the web copy cannot load, a monospace still sets the figures; Chinese falls through to --sans. */
  --mono: "Lucent Mono", "Noto Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, var(--sans);

  --name-grad: linear-gradient(100deg, #ff6a3c, #ffa14e 52%, #ffd07a);
  --ring: conic-gradient(from 200deg, #ffb259, #e8452a, #ff8fae, #ffd07a, #ffb259);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --content-max: 1200px;
}

:root[data-theme="dark"] {
  --ink: #eef1f8;
  --ink-2: rgba(238, 241, 248, 0.66);
  --ink-3: rgba(238, 241, 248, 0.46);
  --ink-4: rgba(238, 241, 248, 0.22);

  --page: #07080e;

  --glass: rgba(20, 23, 34, 0.36);
  --glass-2: rgba(22, 25, 38, 0.56);
  --glass-3: rgba(24, 27, 42, 0.74);
  --glass-line: rgba(255, 255, 255, 0.12);
  --glass-top: rgba(255, 255, 255, 0.14);
  --glass-deep: 0 26px 64px rgba(0, 0, 0, 0.5);
  --glass-soft: 0 12px 30px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background-color: var(--page);
  background-image: url("./assets/wallpaper.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input[type="search"]::-webkit-search-cancel-button { display: none; }
[hidden] { display: none !important; }

:root[data-privacy="private"] .avatar-img { filter: grayscale(0.2); }

/* ---------- 顶栏 ---------- */
/* 窄屏：时钟与图标一行，动作横带独占一行；宽屏：三者同一行 */

.topbar {
  position: relative;
  z-index: 5;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--safe-t) + 26px) 40px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 14px;
  row-gap: 16px;
}

.topbar-left { display: contents; }

.clock { order: 1; display: flex; flex-direction: column; line-height: 1; }
.clock strong {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 1.5px;
  font-variant-numeric: tabular-nums;
  color: var(--shell-ink);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}
.clock span {
  /* Set as on the MatePad: the line sits 0.86 px lower there (measured), the strut of its system font. */
  position: relative;
  top: 0.86px;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--shell-ink-2);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.actions { order: 3; flex: 1 1 100%; display: flex; gap: 9px; flex-wrap: wrap; }

.abtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--shell-glass-2);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shell-shadow), inset 0 1px 0 var(--shell-top);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--shell-ink);
  transition: transform 0.16s ease, box-shadow 0.24s ease;
}
.abtn svg { width: 16px; height: 16px; }
.abtn:active { transform: scale(0.97); }

.abtn.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 22px rgba(200, 50, 20, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  font-weight: 600;
}

.topbar-actions { order: 2; margin-left: auto; display: flex; gap: 9px; }

/* 历史记录：浮在卡片右上角的菱形标签；框体倾斜（skewX），内容保持直立 */
#btnHistory {
  position: absolute;
  top: -104px;
  right: 52px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  height: 46px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  white-space: nowrap;
  color: var(--ink);
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transform: scale(0.92);
}
#btnHistory > svg { width: 17px; height: 17px; flex: none; }
#btnHistory::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 0;
  background: rgba(252, 253, 255, 0.41);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-soft), inset 0 1px 0 var(--glass-top);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  transform: skewX(-14deg);
}
:root[data-theme="dark"] #btnHistory::before { background: rgba(20, 23, 34, 0.44); }
#btnHistory:active::before { transform: skewX(-14deg) scale(0.97); }
@media (hover: hover) {
  #btnHistory:hover::before { background: rgba(255, 255, 255, 0.55); }
  :root[data-theme="dark"] #btnHistory:hover::before { background: rgba(30, 34, 48, 0.62); }
}
#btnHistory .arrow {
  width: 18px;
  height: 18px;
  margin-left: 2px;
  opacity: 0.9;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--shell-glass-2);
  border: 1px solid var(--shell-line);
  box-shadow: var(--shell-shadow), inset 0 1px 0 var(--shell-top);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  color: var(--shell-ink-2);
  transition: transform 0.18s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:active { transform: scale(0.93); }

/* 阴阳壁纸开关：对角渐层，切换时渐变方向翻转（靠两个 stop 的颜色对调实现） */
.wp-toggle { position: relative; align-self: center; }
/* 随机模式：图标左上角一枚绿色呼吸灯 */
.wp-dot {
  position: absolute;
  left: 13.4px;
  top: 10.4px;
  width: 3.6px;
  height: 3.6px;
  border-radius: 50%;
  background: #43D17C;
  box-shadow: 0 0 5px rgba(67, 209, 124, 0.8);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
}
.wp-toggle.random .wp-dot,
.interaction-launcher.is-enabled .wp-dot {
  opacity: 1;
  transform: scale(1);
  animation: wpBreathe 2.4s ease-in-out infinite;
}
@keyframes wpBreathe {
  0%, 100% { opacity: 0.45; box-shadow: 0 0 3px rgba(67, 209, 124, 0.45); }
  50% { opacity: 1; box-shadow: 0 0 7px rgba(67, 209, 124, 1); }
}
.wp-toggle .wp-g1 { stop-color: #EFF3F9; transition: stop-color 0.3s ease; }
.wp-toggle .wp-g2 { stop-color: #2A3346; transition: stop-color 0.3s ease; }
.wp-toggle.yang .wp-g1 { stop-color: #2A3346; }
.wp-toggle.yang .wp-g2 { stop-color: #EFF3F9; }
:root[data-theme="dark"] .wp-toggle .wp-g1 { stop-color: #E8EEF8; }
:root[data-theme="dark"] .wp-toggle .wp-g2 { stop-color: #4E5C74; }
:root[data-theme="dark"] .wp-toggle.yang .wp-g1 { stop-color: #4E5C74; }
:root[data-theme="dark"] .wp-toggle.yang .wp-g2 { stop-color: #E8EEF8; }

/* 壁纸层：位于壁纸之上、内容之下；模糊与亮度只作用于这一层，不会糊到界面 */
.wp-img {
  position: fixed;
  inset: -26px;
  z-index: 0;
  pointer-events: none;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(var(--wp-blur, 0px)) brightness(var(--wp-bright, 1));
  -webkit-filter: blur(var(--wp-blur, 0px)) brightness(var(--wp-bright, 1));
}

/* 壁纸面板 */
.wp-picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.wp-pick {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  transition: transform 0.16s ease, box-shadow 0.2s ease;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.wp-pick:active { transform: scale(0.98); }
.wp-pick.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), inset 0 1px 0 var(--glass-top);
}
.wp-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 14px;
  background: var(--glass-3);
}
.wp-pick .cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px 2px;
}
.wp-pick .cap b {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--ink);
}
.wp-pick .cap span {
  font-size: 10.5px;
  letter-spacing: 0.4px;
  color: var(--ink-3);
}

.wp-mode-note {
  margin: 0 0 14px;
  padding-left: 2px;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--ink-3);
}

/* 面板右上角的【随机】开关：只有描边和圆点，直接长在背景上 */
.wp-random {
  position: absolute;
  top: 24px;
  right: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  background: none;
  border: 0;
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--ink-3);
  transition: top 0.26s cubic-bezier(0.33, 0.9, 0.32, 1), color 0.24s ease;
}
/* 随机开启时多出一行说明，开关跟着轻轻往下让 3.2px */
.wp-random.lower { top: 27.2px; }
.wp-random .wp-track {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 99px;
  border: 1.4px solid var(--ink-3);
  background: none;
  transition: border-color 0.24s ease;
}
.wp-random .wp-knob {
  position: absolute;
  left: 2.4px;
  top: 2.4px;
  width: 10.4px;
  height: 10.4px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform 0.24s cubic-bezier(0.3, 0.9, 0.3, 1), background 0.24s ease;
}
.wp-random[aria-pressed="true"] { color: #43D17C; }
.wp-random[aria-pressed="true"] .wp-track { border-color: rgba(67, 209, 124, 0.8); }
.wp-random[aria-pressed="true"] .wp-knob {
  transform: translateX(15.4px);
  background: #43D17C;
}

.wp-blurrow,
.wp-brightrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 0 4px;
}
/* 亮度与柔焦成对：两条轨道贴成一组，组内留白比组间更紧 */
.wp-brightrow { margin-top: 18px; }
.wp-blurrow .wp-label,
.wp-brightrow .wp-label {
  flex: none;
  font-size: 11.5px;
  letter-spacing: 1.4px;
  color: var(--ink-3);
}
.wp-blurrow .wp-value,
.wp-brightrow .wp-value {
  flex: none;
  min-width: 40px;
  text-align: right;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
/* 亮度与柔焦的收放：Light 选中时向左收起来，取景入口同时淡入一下 */
.wp-brightrow {
  overflow: hidden;
  max-height: 44px;
  transition: max-height .28s cubic-bezier(.22, .9, .3, 1), opacity .22s ease, margin-top .28s cubic-bezier(.22, .9, .3, 1);
}
.wp-brightrow.off {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}
.wp-brightrow .wp-range { transition: transform .28s cubic-bezier(.22, .9, .3, 1); transform-origin: left center; }
.wp-brightrow.off .wp-range { transform: scaleX(.35); }

/* 缩略图里的取景视图 */
.wp-thumbwrap { position: relative; display: block; }
.wp-thumb-view { position: relative; display: block; overflow: hidden; }
.wp-thumb-view .wp-thumb-src { position: absolute; display: block; max-width: none; }

/* 柔焦行右端的取景入口：一枚小菱形（magic / inspiration 的那点灵气）；
   亮度行同一位置放「默认」小字，点它回到出厂 74% */
.wp-zoom,
.wp-default {
  flex: none;
  width: 24px;
}
.wp-zoom {
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .42);
  background: rgba(18, 20, 24, .1);
  color: var(--ink-2);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.wp-zoom svg { width: 13px; height: 13px; }
.wp-zoom:hover { color: var(--accent); border-color: rgba(255, 255, 255, .62); }
.wp-zoom:active { transform: scale(.92); }
.wp-zoom.just { animation: spark-in .36s cubic-bezier(.22, .9, .3, 1); }
@keyframes spark-in {
  0% { opacity: 0; transform: scale(.55) rotate(-28deg); }
  62% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.wp-default {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 2.5px;
  cursor: pointer;
  transition: color .18s ease, opacity .18s ease;
}
.wp-default:hover { color: var(--ink-2); }
.wp-default:active { opacity: .65; }

/* 取景编辑器（Light / Dark 裁切调整） */
.crop-editor { display: flex; flex-direction: column; gap: 14px; }
.crop-hint { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); letter-spacing: .3px; }
.crop-box {
  position: relative;
  aspect-ratio: 2 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
  touch-action: none;
}
.crop-photo { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.crop-frame {
  position: absolute;
  border: 1.5px solid rgba(255, 255, 255, .92);
  border-radius: 10px;
  box-shadow: 0 0 0 2000px rgba(12, 14, 18, .46);
  cursor: grab;
  touch-action: none;
}
.crop-frame.dragging { cursor: grabbing; }
.crop-preview-label { margin: 0; font-size: 11.5px; letter-spacing: .8px; color: var(--ink-3); text-align: center; }
/* 取景窗口的两个按钮：跟在内容最下面，滚到底再确认 */
.crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding: 0 2px 2px;
}
.crop-preview {
  position: relative;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-line);
  background: var(--glass-3);
  box-shadow: 0 8px 22px rgba(20, 22, 28, .16);
}
.crop-preview-layer { position: absolute; inset: 0; background-repeat: no-repeat; }
.crop-preview-stage,
.crop-preview-stage * { pointer-events: none; }
.crop-preview-stage { position: absolute; left: 0; top: 0; transform-origin: left top; }
.wp-range {
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
}
.wp-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 99px;
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
}
.wp-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(120, 150, 180, 0.28);
  box-shadow: 0 3px 10px rgba(6, 10, 24, 0.22);
}
.wp-range::-moz-range-track {
  height: 6px;
  border-radius: 99px;
  background: var(--glass-3);
}
.wp-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(120, 150, 180, 0.28);
}
:root[data-theme="dark"] .wp-range::-webkit-slider-thumb { background: #E8EDF6; }

/* ---------- 页面骨架 ---------- */

.page {
  position: relative;
  z-index: 2;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px 40px calc(150px + var(--safe-b));
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 4px 34px;
  animation: enter 0.55s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}

.card {
  position: relative;
  padding: 20px;
  border-radius: 28px;
  background: rgba(252, 253, 255, 0.42);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-deep), inset 0 1px 0 var(--glass-top);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  animation: enter 0.55s cubic-bezier(0.22, 0.9, 0.3, 1) 0.07s both;
  overflow: visible;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0) 44%);
}
:root[data-theme="dark"] .card {
  background: var(--glass-2);
}
:root[data-theme="dark"] .card::before {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 44%);
}

/* ---------- 头像 ---------- */

.avatar { position: relative; width: 92px; height: 92px; margin-bottom: 16px; }

.avatar-halo {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 168, 110, 0.4), rgba(255, 120, 70, 0.2) 52%, transparent 72%);
  filter: blur(14px);
  animation: pulse 6s ease-in-out infinite;
}

.avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--ring);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  animation: spin 14s linear infinite;
  z-index: 3;
}

.avatar-img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.avatar-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #34d17b;
  box-shadow: 0 0 0 3px rgba(16, 18, 26, 0.72), 0 0 14px rgba(52, 209, 123, 0.8);
  z-index: 4;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
:root[data-privacy="private"] .avatar-dot {
  background: #9a6bff;
  box-shadow: 0 0 0 3px rgba(16, 18, 26, 0.72), 0 0 14px rgba(154, 107, 255, 0.8);
}

.floaters { position: absolute; inset: -22px; z-index: 1; pointer-events: none; }
.fl { position: absolute; width: 15px; height: 15px; }
.fl-1 { color: #ff9ab0; left: -6px; top: 24px; animation: drift 6.4s ease-in-out infinite; }
.fl-2 { color: #ffd48a; right: -10px; top: 2px; width: 17px; height: 17px; animation: drift 7.8s ease-in-out infinite reverse; }

/* ---------- 名字与资料（外壳层） ---------- */

.name {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.16;
  background-image: var(--name-grad);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.42));
  animation: shimmer 9s linear infinite;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--shell-glass);
  border: 1px solid var(--shell-line);
  box-shadow: inset 0 1px 0 var(--shell-top);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--shell-ink-2);
}
.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d17b;
  box-shadow: 0 0 7px rgba(52, 209, 123, 0.9);
  transition: background 0.3s ease;
}
:root[data-privacy="private"] .status-pill i { background: #9a6bff; box-shadow: 0 0 7px rgba(154, 107, 255, 0.9); }

.meta-text {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--shell-ink-2);
}

.signature {
  margin: 14px 0 0;
  max-width: 24em;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.74;
  letter-spacing: 0.4px;
  color: var(--shell-ink);
  opacity: 0.92;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.6);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 15px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 25px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--shell-glass);
  border: 1px solid var(--shell-line);
  box-shadow: inset 0 1px 0 var(--shell-top);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--shell-ink-2);
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge .ice-cube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  font-size: 11px;
  line-height: 1;
}
.badge .ice-cube img { display: block; width: 100%; height: 100%; }
.badge strong { font-weight: 600; color: var(--shell-ink); font-family: var(--mono); letter-spacing: 0.3px; }

.badge.lv { border-color: rgba(255, 176, 110, 0.45); }
.badge.lv svg, .badge.lv strong { color: #ffc07a; }

.badge.live {
  background: linear-gradient(135deg, rgba(255, 160, 90, 0.9), rgba(232, 69, 42, 0.9));
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.95);
}
.badge.live strong, .badge.live svg { color: #fff; }

.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 9px;
  background: var(--shell-glass);
  border: 1px solid var(--shell-line);
  box-shadow: inset 0 1px 0 var(--shell-top);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  font-size: 11.5px;
  line-height: 1;
  letter-spacing: 0.5px;
  color: var(--shell-ink-2);
  transition: transform 0.16s ease;
}
.tag:active { transform: scale(0.95); }
.tag.ghost { border-style: dashed; border-color: rgba(255, 255, 255, 0.3); }

/* ---------- 卡片内部（浅玻璃 + 深字） ---------- */

.search {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 52px;
  padding: 0 8px 0 16px;
  border-radius: 15px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 3px rgba(20, 26, 52, 0.04), inset 0 -1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
}

.search-icon { width: 17px; height: 17px; color: var(--ink-3); flex: none; }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  letter-spacing: 0.3px;
}
.search input::placeholder { color: var(--ink-3); }

.search-go {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 8px 18px rgba(18, 24, 48, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition: transform 0.16s ease;
}
.search-go svg { width: 16px; height: 16px; }
.search-go:active { transform: scale(0.92); }

.block { position: relative; z-index: 1; padding: 20px 2px 6px; }

.block-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0 11px;
}

.block-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2.6px;
  color: var(--ink-3);
}
.block-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink-4);
  opacity: 0.7;
}

.mini {
  height: 28px;
  padding: 0 12px;
  border-radius: 9px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  color: var(--ink-2);
  transition: transform 0.16s ease;
}
.mini:active { transform: scale(0.94); }
.mini.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }

#btnEditOrder {
  font-size: 10px;
  padding: 0 8px;
}

.shelf-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  font-size: 10px;
  line-height: 1;
}

.shelf-mini > svg {
  display: block;
  width: 11px;
  height: 11px;
  color: #4f86a8;
}

.shelf-mini > span {
  display: block;
  line-height: 1;
}

:root[data-theme="dark"] .shelf-mini > svg { color: #9cc8e2; }

.fold {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  backdrop-filter: var(--blur-sm);
  -webkit-backdrop-filter: var(--blur-sm);
  color: var(--ink-3);
  transition: transform 0.16s ease;
}
.fold svg { width: 15px; height: 15px; transition: transform 0.34s cubic-bezier(0.22, 0.9, 0.3, 1); }
.fold:active { transform: scale(0.92); }
.block.collapsed .fold svg { transform: rotate(-180deg); }
.block.collapsed .fold { color: var(--ink-2); }

.block-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.36s cubic-bezier(0.22, 0.9, 0.3, 1);
  overflow: hidden;
}
.block-body > * { min-height: 0; }
.block.collapsed .block-body { grid-template-rows: 0fr; }
.block.collapsed { padding-bottom: 0; }
.block.collapsed .block-head { margin-bottom: 0; }

/* 搜索引擎 chips */

.chips {
  display: flex;
  gap: 9px;
  padding: 2px 11px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 15px;
  border-radius: 13px;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(255, 244, 225, .18), transparent 65%),
    linear-gradient(120deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .035) 48%, rgba(252, 247, 240, .09));
  border: 1px solid rgba(255, 251, 244, .38);
  border-top-color: rgba(255, 255, 255, .68);
  border-bottom-color: rgba(230, 224, 214, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .48), inset 0 -1px 0 rgba(83, 76, 65, .09), 0 2px 5px rgba(28, 24, 20, .045);
  backdrop-filter: blur(6px) saturate(112%);
  -webkit-backdrop-filter: blur(6px) saturate(112%);
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--ink-2);
  transition: transform 0.16s ease, background 0.24s ease, border-color 0.24s ease;
}
.chip:active { transform: scale(0.96); }
.chip .ci {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(255, 252, 247, .12);
  border: 1px solid rgba(255, 255, 255, .26);
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
}
.chip .ci img { width: 100%; height: 100%; object-fit: cover; }
.chip.active {
  background:
    radial-gradient(ellipse at 10% 0%, rgba(255, 240, 215, .22), transparent 65%),
    linear-gradient(120deg, rgba(255, 255, 255, .19), rgba(255, 255, 255, .055) 48%, rgba(252, 247, 240, .12));
  border-color: rgba(232, 69, 42, .48);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(232, 69, 42, .10), inset 0 1px 0 rgba(255, 255, 255, .64), inset 0 -1px 0 rgba(83, 76, 65, .08), 0 2px 6px rgba(28, 24, 20, .05);
}

/* 快捷方式网格 */

.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 4px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 11px 4px 10px;
  border-radius: 16px;
  transition: transform 0.16s ease, background 0.2s ease;
}
.tile:active { transform: scale(0.95); }

.tile .ticon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-soft), inset 0 1px 0 var(--glass-top);
  font-size: 21px;
  font-weight: 650;
  color: var(--ink-2);
}
.tile .ticon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* 装框：把抓回来的图标放进一枚白色画框，观感像 App 图标 */
.tile .ticon.framed { padding: 4px; background: var(--glass-2); }
.tile .ticon .plate {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 6px;
  overflow: hidden;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(18, 28, 42, 0.07), 0 1px 2px rgba(12, 20, 32, 0.08);
}
.tile .ticon .plate img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.tile .ticon .plate svg { width: 100%; height: 100%; }

/* 首字母牌：底色可选，字自动取对比色 */
.tile .ticon.lettered,
.icon-opt .ticon.lettered {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: var(--glass-soft), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.tile .tlabel {
  max-width: 100%;
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile.add .ticon {
  background: transparent;
  border-style: dashed;
  border-color: var(--ink-4);
  box-shadow: none;
  color: var(--ink-3);
}
/* The plus fills its tile, as the MatePad draws it. */
.tile.add .ticon svg { width: 100%; height: 100%; }

.grid.editing .tile { animation: jiggle 0.46s ease-in-out infinite; touch-action: none; }
.grid.editing .tile:nth-child(even) { animation-delay: 0.14s; }
.grid.editing .tile:nth-child(3n) { animation-delay: 0.26s; }

.tile.dragging {
  z-index: 6;
  transform: scale(1.08);
  background: var(--glass-3);
  box-shadow: var(--glass-deep);
  opacity: 0.95;
}

/* 直达列表 */

.rows { position: relative; z-index: 1; display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 58px;
  padding: 0 11px;
  border-radius: 14px;
  text-align: left;
  transition: background 0.18s ease;
}
.row:not(:first-child) { position: relative; }
.row:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 13px;
  right: 13px;
  height: 1px;
  background: var(--ink-4);
  opacity: 0.6;
}
.row:active { background: var(--glass); }

.row .ricon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
}
.row .ricon svg { width: 18px; height: 18px; }

.row .rtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row .rlabel { font-size: 14.5px; font-weight: 550; letter-spacing: 0.4px; color: var(--ink); }
.row .rhint { font-size: 11px; letter-spacing: 0.6px; color: var(--ink-3); }

.row .rchev { flex: none; width: 15px; height: 15px; color: var(--ink-4); }

.r-order { display: none; flex: none; align-items: center; gap: 2px; }
.rows.editing .r-order { display: flex; }
.rows.editing .rchev { display: none; }

.r-move {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--ink-2);
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.r-move:active { transform: scale(0.94); }

/* ---------- 名片编辑：左右双面板 ---------- */

.edit-root {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 24px;
}

.edit-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.22s ease;
}

.edit-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: min(94vw, 1040px);
  animation: rise 0.28s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.edit-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: min(60vh, 520px);
  padding: 22px;
  border-radius: 24px;
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-deep), inset 0 1px 0 var(--glass-top);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  overflow: auto;
}

.edit-panel h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.panel-hint {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.4px;
  color: var(--ink-3);
}

.tag-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 30px;
}
.tag-edit .tag { color: var(--ink-2); gap: 6px; padding-right: 6px; }

.tag-kill {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  color: var(--ink-3);
  background: rgba(20, 22, 30, 0.06);
}
.tag-kill:active { color: #ff4d5e; }

.tag-add { display: flex; gap: 8px; }
.tag-add input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 13px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  outline: none;
  font-size: 14px;
}
.tag-add input:focus { border-color: var(--accent); }

.info-row { display: flex; flex-wrap: wrap; gap: 8px; }

.edit-panel .sheet-actions { margin-top: auto; }

@media (max-width: 899px) {
  .edit-stage {
    grid-template-columns: minmax(0, 1fr);
    width: min(92vw, 460px);
    gap: 14px;
  }
  .edit-panel { height: auto; max-height: 42vh; }
}

/* ---------- 面板与提示 ---------- */

.sheet-root { position: fixed; inset: 0; z-index: 26; }

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 16, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.22s ease;
}

.sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-b));
  max-width: 540px;
  max-height: 78dvh;
  margin-inline: auto;
  padding: 20px;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: 24px;
  background: linear-gradient(156deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--glass-deep), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(38px) saturate(200%);
  -webkit-backdrop-filter: blur(38px) saturate(200%);
  animation: rise 0.28s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.sheet::-webkit-scrollbar { display: none; }
:root[data-theme="dark"] .sheet {
  background: linear-gradient(156deg, rgba(20, 23, 34, 0.6), rgba(16, 18, 28, 0.5));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--glass-deep), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* 宽版面板：更大气、更多留白 */
.sheet.wide {
  max-width: 760px;
  padding: 30px 32px 26px;
  border-radius: 28px;
}
.sheet.wide .sheet-title { font-size: 18.5px; margin-bottom: 18px; }

/* 居中版面板（长按图标编辑用） */
.sheet.center {
  top: 50%;
  bottom: auto;
  max-height: 76dvh;
  transform: translateY(-50%);
  animation: rise-center 0.3s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.sheet-title { margin: 0 0 4px; font-size: 16.5px; font-weight: 700; letter-spacing: 0.4px; }
.sheet-sub { margin: 0 0 14px; font-size: 12px; color: var(--ink-3); line-height: 1.55; letter-spacing: 0.3px; }

/* 长按太阳图标浮出的「关于」窗口：左上两行题词，右侧灵感台预览，左侧产品自述，右下落款签名 */
#btnSettings { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.about-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 42%);
  grid-template-areas: "head frame" "copy frame" "meta sign";
  column-gap: 30px;
  row-gap: 16px;
  align-items: start;
}
.about-heading { grid-area: head; display: grid; gap: 7.25px; }
/* 主标题：中等偏淡的金，一点点烫金 */
.about-brand { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.4px; color: #BD9A3E; }
:root[data-theme="dark"] .about-brand { color: #D5B564; }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .about-brand {
    background-image: linear-gradient(158deg, #DFC47E 2%, #C7A347 52%, #A9822A 98%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  :root[data-theme="dark"] .about-brand { background-image: linear-gradient(158deg, #F0DCA4 2%, #D8B966 52%, #C09A45 98%); }
}
.about-motto { margin: 0; font-size: 11px; letter-spacing: 0.3px; color: var(--ink-3); }
.about-copy { grid-area: copy; display: grid; gap: 10px; }
.about-kicker { margin: 0 0 1px; font-size: 10.5px; font-weight: 500; letter-spacing: 5px; color: var(--ink-3); }
.about-copy p { margin: 0; font-size: 13.5px; line-height: 1.95; letter-spacing: 0.3px; color: var(--ink-2); }
/* 新动态：浮在右栏的图与金色签名之间，右对齐；不占版面，卡片大小与 5.0 一致 */
.about-news { position: absolute; top: calc(100% + 19.8px); right: 0; margin: 0; text-align: right; white-space: nowrap; font-size: 11px; line-height: 1.7; letter-spacing: 0.4px; color: #5b8cb9; }
.about-news-url { display: block; font-size: 10.5px; letter-spacing: 0.6px; opacity: 0.88; }
:root[data-theme="dark"] .about-news { color: #9fc4e2; }
.about-meta { grid-area: meta; display: grid; gap: 6px; margin-top: 2px; padding-top: 14px; border-top: 1px solid var(--ink-4); }
.about-version { margin: 0; font-size: 13px; letter-spacing: 0.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.about-build { margin: 0; font-size: 10.5px; letter-spacing: 1px; color: var(--ink-3); }
.about-frame { grid-area: frame; margin: 0; position: relative; }
.about-shot {
  display: block;
  width: 92%;
  margin-left: auto;
  position: relative;
  top: -0.8px;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 28px rgba(18, 30, 45, 0.18);
  background: var(--glass);
}
:root[data-theme="dark"] .about-shot { border-color: rgba(255, 255, 255, 0.16); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.36); }
/* 右下角落款：明暗两张亲笔图随主题换，普通金（标题的 #BD9A3E / #D5B564），直接落图不走 mask */
.about-sign {
  grid-area: sign;
  justify-self: end;
  align-self: end;
  width: 152px;
  margin-right: 10px;
  margin-bottom: 18px;
  transform: translate(-0.27px, 1.335px) scale(1.075);
  transform-origin: 100% 100%;
}
.about-sign img { display: block; width: 100%; height: auto; }
.about-sign .about-sign-dark { display: none; }
:root[data-theme="dark"] .about-sign .about-sign-light { display: none; }
:root[data-theme="dark"] .about-sign .about-sign-dark { display: block; }

@media (max-width: 520px) {
  .sheet.wide.about-sheet { padding: 24px 20px 20px; }
  .about-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "frame" "sign" "copy" "meta"; }
  .about-news { position: static; margin-top: 12px; }
  .about-copy p { font-size: 13px; line-height: 1.85; }
}

.sheet-list { display: flex; flex-direction: column; margin: 0 -6px; }

.act {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 50px;
  padding: 0 11px;
  border-radius: 13px;
  text-align: left;
  font-size: 15px;
  color: var(--ink);
  transition: background 0.18s ease;
}
.act:active { background: var(--glass); }
.act svg { width: 18px; height: 18px; color: var(--ink-2); flex: none; }
.act .act-label { flex: 1; letter-spacing: 0.3px; }
.act.danger { color: #ff4d5e; }
.act.danger svg { color: #ff4d5e; }

.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }

.btn {
  flex: 1;
  height: 47px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--ink);
  transition: transform 0.16s ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn.danger { color: #ff4d5e; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 11.5px; letter-spacing: 1px; color: var(--ink-3); padding-left: 2px; }
.field input, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 13px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  outline: none;
  font-size: 15px;
  font-family: inherit;
  resize: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }

/* 图标编辑面板 */
.icon-editor { margin: 2px 0 2px; }

.icon-opts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.icon-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 13px 6px 11px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  transition: transform 0.16s ease, border-color 0.2s ease;
}
.icon-opt:active { transform: scale(0.97); }
.icon-opt.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), inset 0 1px 0 var(--glass-top);
}
.icon-opt .ticon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-soft), inset 0 1px 0 var(--glass-top);
  font-size: 18px;
  font-weight: 650;
  color: var(--ink-2);
}
.icon-opt .ticon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.icon-opt .ticon.framed { padding: 4px; background: var(--glass-2); }
.icon-opt .ticon .plate {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 5px;
  overflow: hidden;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(18, 28, 42, 0.07);
}
.icon-opt .ticon .plate img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.icon-opt .ticon .plate svg { width: 100%; height: 100%; }
.icon-opt .cap {
  font-size: 11.5px;
  letter-spacing: 0.6px;
  color: var(--ink-2);
}
.icon-opt.on .cap { color: var(--ink); font-weight: 600; }

.icon-color { margin-top: 16px; }
.icon-color[hidden] { display: none; }
.icon-note {
  margin: 0 0 9px;
  padding-left: 2px;
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--ink-3);
}
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch-groups { margin-top: 14px; }
.swatch-group + .swatch-group { margin-top: 13px; }
.icon-note.sub {
  margin: 0 0 8px;
  padding-left: 2px;
  font-size: 10.5px;
  letter-spacing: 2.5px;
  color: var(--ink-4);
}
.swatch {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  transition: transform 0.16s ease, box-shadow 0.2s ease;
}
.swatch:active { transform: scale(0.94); }
.swatch.on { box-shadow: 0 0 0 2px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.3); }

/* 日志：贴在主题卡片右下角外侧的一句白字 */
.daily-log {
  position: absolute;
  right: -24px;
  bottom: -86px;
  max-width: 86%;
  padding: 6px 2px;
  background: none;
  border: 0;
  text-align: right;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  line-height: 1.55;
  color: #ffffff;
  opacity: 0.94;
  text-shadow: 0 1px 14px rgba(6, 12, 20, 0.55), 0 0 1px rgba(6, 12, 20, 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease, transform 0.16s ease;
}
.daily-log:active { opacity: 0.7; transform: scale(0.99); }

/* 日志面板 */
.log-editor { margin: 2px 0; }
.log-save { display: flex; justify-content: flex-end; margin: -2px 0 18px; }

/* 日志面板里的按钮收小一点：不要拉满宽、不要 47px 高 */
.log-save .btn,
.btn.sm {
  flex: 0 0 auto;
  height: 38px;
  min-width: 0;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 13.5px;
}
.sheet.center .sheet-actions { justify-content: flex-end; }

.log-list { display: flex; flex-direction: column; gap: 9px; }

/* 历史记录：内嵌的淡橙色小天地 */
.log-history {
  margin-top: 4px;
  padding: 15px 14px 13px;
  border-radius: 20px;
  background: linear-gradient(158deg, rgba(250, 223, 194, 0.5), rgba(245, 208, 172, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 8px 24px rgba(120, 70, 30, 0.08);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
:root[data-theme="dark"] .log-history {
  background: linear-gradient(158deg, rgba(150, 96, 52, 0.34), rgba(118, 72, 36, 0.26));
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 24px rgba(0, 0, 0, 0.26);
}
.log-brand {
  margin: 0 0 13px;
  font-size: 16.6px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: #B4562A;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.log-history .log-item {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
:root[data-theme="dark"] .log-history .log-item {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}
.log-history .log-date { color: rgba(140, 84, 40, 0.62); }
.log-history .log-empty { color: rgba(140, 84, 40, 0.7); }
.log-history .log-page-btn {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(150, 92, 44, 0.18);
  color: #8A5426;
}
.log-history .log-pageinfo { color: rgba(140, 84, 40, 0.78); }

/* 无底版本：条目直接写在面板玻璃上，靠间距和细分隔线撑着 */
.log-history.plain {
  padding: 13px 0 0;
  background: none;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.log-history.plain .log-brand {
  margin-bottom: 9px;
  text-shadow: none;
}
.log-history.plain .log-row { border-radius: 10px; }
.log-history.plain .log-row + .log-row { border-top: 1px solid rgba(18, 28, 42, 0.1); }
.log-history.plain .log-item {
  padding: 10px 2px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  gap: 6px;
}
.log-history.plain .log-date { color: var(--ink-3); letter-spacing: 0.5px; }
.log-history.plain .log-remove {
  border-radius: 10px;
  margin-left: 8px;
}
:root[data-theme="dark"] .log-history.plain .log-row + .log-row {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* 编辑名片里，签名字段下方右下角的小按钮：名片面板的玻璃质感 + 一层淡橙 */
.field-more { display: flex; justify-content: flex-end; margin: -8px 0 14px; }
.btn.warm {
  background: linear-gradient(158deg, rgba(255, 245, 236, 0.72), rgba(253, 232, 212, 0.62));
  border-color: rgba(198, 134, 74, 0.26);
  color: #9C5A2C;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}
:root[data-theme="dark"] .btn.warm {
  background: linear-gradient(158deg, rgba(118, 78, 44, 0.34), rgba(94, 60, 32, 0.32));
  border-color: rgba(226, 165, 110, 0.26);
  color: #EFC69E;
}

.log-row { position: relative; overflow: hidden; border-radius: 14px; }
.log-row-inner {
  display: flex;
  width: calc(100% + 88px);
  transition: transform 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
  will-change: transform;
}
.log-remove {
  flex: 0 0 88px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(200deg, #e0524c, #c23a38);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 1.5px;
}
.log-remove:active { background: linear-gradient(200deg, #cf4a44, #ad3230); }
.log-item {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  touch-action: pan-y;
}
.log-date {
  font-size: 11px;
  letter-spacing: 0.7px;
  color: var(--ink-4);
}
.log-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  word-break: break-word;
}
.log-line { display: block; }
.log-tag {
  margin-left: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #6FA8DC;
  white-space: nowrap;
}
:root[data-theme="dark"] .log-tag { color: #9CC7EE; }
.log-empty {
  margin: 0;
  padding: 14px 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.log-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.log-page-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--glass-3);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-top);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
}
.log-page-btn:disabled { opacity: 0.35; }
.log-pageinfo { font-size: 12px; letter-spacing: 0.6px; color: var(--ink-3); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + var(--safe-b));
  z-index: 30;
  transform: translateX(-50%);
  max-width: min(86vw, 460px);
  padding: 11px 18px;
  border-radius: 13px;
  background: rgba(14, 16, 26, 0.9);
  color: #fff;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  line-height: 1.5;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: rise 0.24s cubic-bezier(0.22, 0.9, 0.3, 1);
}

/* ---------- 大屏（平板 / 桌面） ---------- */

@media (min-width: 900px) {
  .topbar { padding-top: calc(var(--safe-t) + 30px); flex-wrap: nowrap; }

  .topbar-left { display: flex; flex-direction: row; align-items: center; gap: 22px; }

  .actions { flex: 0 1 auto; }

  .clock strong { font-size: 28px; }

  .page {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
    padding-top: 8px;
  }

  .hero {
    align-items: flex-start;
    text-align: left;
    justify-content: center;
    min-height: calc(100vh - 170px);
    padding: 24px 0;
  }
  .hero .meta, .hero .badges, .hero .tags { justify-content: flex-start; }

  .avatar { width: 96px; height: 96px; }
  .name { font-size: 34px; }
  .signature { max-width: 22em; }

  .card { padding: 26px; }
  /* 短横屏守卫写入的下移量（见 app.js guardCardClearance）；平板比例下为 0 */
  .page > .card { top: var(--card-drop, 0px); }

  /* 宽屏下直达走双列：卡片矮下来，照片才有呼吸的余地 */
  .rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
  }
  .row { height: 54px; }
  .row:not(:first-child)::before { display: none; }

  /* 两段都折叠时：卡片下沉到视觉中心略偏下，搜索成为焦点（5.1.3：原先只按页面盒居中，整组看着偏高） */
  :root[data-focus="on"] .page {
    align-items: center;
    min-height: calc(100vh - 150px);
    padding-top: calc(8px + 16vh);
  }
  :root[data-focus="on"] .hero { min-height: auto; }
}

@media (min-width: 1240px) {
  :root { --content-max: 1240px; }
  .page { gap: 64px; }
  .avatar { width: 104px; height: 104px; }
  .name { font-size: 38px; }
}

/* ---------- 动效 ---------- */

@keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes rise-center { from { opacity: 0; transform: translateY(-50%) scale(0.965); } to { opacity: 1; transform: translateY(-50%) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes drift { 0%, 100% { transform: translate(0, 0) rotate(-5deg); } 50% { transform: translate(3px, -10px) rotate(6deg); } }
@keyframes shimmer { to { background-position: 220% 0; } }
@keyframes jiggle { 0%, 100% { transform: rotate(-1.3deg); } 50% { transform: rotate(1.3deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
