/* ==========================================================================
   旅迹 TravelLog — design system
   Warm paper palette, terracotta accent, serif display type.
   ========================================================================== */

@layer reset, tokens, base, layout, components, views, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  img, svg, video, canvas { display: block; max-width: 100%; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { background: none; border: 0; cursor: pointer; }
  a { color: inherit; }
  ul, ol { margin: 0; padding: 0; list-style: none; }
  h1, h2, h3, h4, p { margin: 0; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}

@layer tokens {
  :root {
    --paper: #f6f2ea;
    --paper-2: #fbf8f2;
    --surface: #fffdf8;
    --surface-2: #f9f4ec;
    --ink: #241f1a;
    --ink-2: #4a423a;
    --muted: #8a7e70;
    --muted-2: #a99e91;
    --line: #e6ded0;
    --line-strong: #d6cbb8;

    --accent: #b4552f;
    --accent-ink: #8e3f21;
    --accent-soft: #f5e4d9;
    --accent-softer: #faf0e9;

    --green: #3c6e58;
    --green-soft: #e3ede6;
    --blue: #3e5c76;
    --blue-soft: #e4ebf1;
    --amber: #a9741f;
    --amber-soft: #f6ead2;
    --danger: #a83a2e;
    --danger-soft: #f7e3df;

    --r-xs: 8px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-full: 999px;

    --shadow-sm: 0 1px 2px rgba(36, 31, 26, .05);
    --shadow-md: 0 8px 24px -12px rgba(36, 31, 26, .22), 0 2px 6px rgba(36, 31, 26, .04);
    --shadow-lg: 0 28px 64px -28px rgba(36, 31, 26, .42);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-serif: ui-serif, "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;

    --sidebar-w: 268px;
    --content-w: 1100px;
    --ease: cubic-bezier(.2, .7, .3, 1);
  }
}

@layer base {
  html { -webkit-text-size-adjust: 100%; }
  body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background:
      radial-gradient(1200px 500px at 12% -8%, #fdf9f1 0%, rgba(253, 249, 241, 0) 60%),
      radial-gradient(900px 420px at 92% 4%, #f7eee2 0%, rgba(247, 238, 226, 0) 55%),
      var(--paper);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
  }
  ::selection { background: #f0d3c2; color: var(--accent-ink); }

  h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; letter-spacing: .01em; line-height: 1.25; }
  h1 { font-size: clamp(26px, 3.4vw, 38px); }
  h2 { font-size: clamp(20px, 2.2vw, 25px); }
  h3 { font-size: 17px; }

  .eyebrow {
    font-family: var(--font-sans);
    font-size: 11.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
  }
  .muted { color: var(--muted); }
  .small { font-size: 13px; }
  .tiny { font-size: 11.5px; }
  .serif { font-family: var(--font-serif); }
  .num { font-variant-numeric: tabular-nums; }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .hidden { display: none !important; }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .row { display: flex; align-items: center; gap: 10px; }
  .row.wrap { flex-wrap: wrap; }
  .col { display: flex; flex-direction: column; gap: 10px; }
  .spacer { flex: 1; }
  .stack { display: flex; flex-direction: column; gap: 18px; }
  .stack-sm { display: flex; flex-direction: column; gap: 10px; }
}

/* ------------------------------------------------------------------ layout */
@layer layout {
  .app { min-height: 100dvh; }

  .shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 22px 16px 18px;
    border-right: 1px solid rgba(214, 203, 184, .55);
    background: linear-gradient(180deg, rgba(253, 250, 244, .92), rgba(250, 245, 236, .78));
    backdrop-filter: blur(6px);
  }

  .brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 2px; text-decoration: none; }
  .brand-mark {
    width: 38px; height: 38px; flex: 0 0 auto;
    display: grid; place-items: center;
    border-radius: 12px;
    background: linear-gradient(150deg, #c4643c, #9c4423);
    color: #fff7ef;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 6px 14px -8px rgba(142, 63, 33, .8);
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 600;
  }
  .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
  .brand-text b { font-family: var(--font-serif); font-size: 17px; letter-spacing: .06em; }
  .brand-text span { font-size: 10.5px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }

  .nav { display: flex; flex-direction: column; gap: 3px; }
  .nav-label { padding: 12px 12px 6px; }
  .nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .18s var(--ease), color .18s var(--ease);
    position: relative;
  }
  .nav-item svg { flex: 0 0 auto; opacity: .72; }
  .nav-item:hover { background: rgba(230, 222, 208, .42); color: var(--ink); }
  .nav-item.is-active { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
  .nav-item.is-active svg { opacity: 1; }
  .nav-item.is-active::before {
    content: ""; position: absolute; left: 0; top: 50%; translate: 0 -50%;
    width: 3px; height: 18px; border-radius: 3px; background: var(--accent);
  }
  .nav-badge {
    margin-left: auto;
    font-size: 11px; font-weight: 600;
    background: var(--accent-soft); color: var(--accent-ink);
    padding: 1px 7px; border-radius: var(--r-full);
  }

  .sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
  .user-chip {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 253, 248, .75);
    text-decoration: none;
    transition: border-color .18s var(--ease), background .18s var(--ease);
  }
  .user-chip:hover { border-color: var(--line-strong); background: var(--surface); }
  .avatar {
    width: 34px; height: 34px; flex: 0 0 auto;
    border-radius: var(--r-full);
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-family: var(--font-serif);
    font-size: 15px; font-weight: 600;
    overflow: hidden;
  }
  .avatar img { width: 100%; height: 100%; object-fit: cover; }
  .avatar.lg { width: 64px; height: 64px; font-size: 24px; }
  .user-chip .meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
  .user-chip .meta b { font-size: 13px; font-weight: 600; }

  .cloud-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .4);
    color: var(--muted);
    font-size: 11.5px;
    text-decoration: none;
    transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
  }
  .cloud-chip:hover { border-color: var(--accent); color: var(--ink-2); background: var(--surface); }
  .cloud-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cloud-chip svg { flex: 0 0 auto; opacity: .6; }

  .main { min-width: 0; padding: 0 clamp(16px, 3vw, 44px) 80px; }
  .view { width: 100%; max-width: var(--content-w); margin: 0 auto; padding-top: 30px; }

  .topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 14px;
    padding: 14px 2px 12px;
    margin-bottom: 2px;
    background: linear-gradient(180deg, var(--paper) 62%, rgba(246, 242, 234, 0));
  }
  .topbar .search {
    flex: 1; max-width: 420px;
    display: flex; align-items: center; gap: 9px;
    padding: 0 13px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--r-full);
    background: rgba(255, 253, 248, .8);
    color: var(--muted);
    transition: border-color .18s var(--ease), background .18s var(--ease);
  }
  .topbar .search:focus-within { border-color: var(--accent); background: var(--surface); }
  .topbar .search input { flex: 1; border: 0; background: none; outline: none; font-size: 13.5px; color: var(--ink); }
  .topbar .search kbd {
    font-family: var(--font-sans); font-size: 11px; color: var(--muted-2);
    border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
  }

  .mobilebar { display: none; }

  .page-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 24px; }
  .page-head .titles { min-width: 0; }
  .page-head p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }
  .page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
}

/* -------------------------------------------------------------- components */
@layer components {
  .btn {
    --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 40px; padding: 0 16px;
    border-radius: var(--r-full);
    background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
    font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
    text-decoration: none; white-space: nowrap;
    transition: transform .16s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
    user-select: none;
  }
  .btn:active { transform: translateY(1px) scale(.995); }
  .btn:disabled { opacity: .5; pointer-events: none; }
  .btn svg { flex: 0 0 auto; }

  .btn-primary { --btn-bg: var(--accent); --btn-fg: #fff8f2; --btn-bd: var(--accent); box-shadow: 0 8px 18px -12px rgba(142, 63, 33, .9); }
  .btn-primary:hover { --btn-bg: #a94b28; }
  .btn-outline { --btn-bg: var(--surface); --btn-bd: var(--line-strong); --btn-fg: var(--ink-2); }
  .btn-outline:hover { --btn-bd: var(--accent); --btn-fg: var(--accent-ink); background: var(--accent-softer); }
  .btn-ghost { --btn-fg: var(--ink-2); }
  .btn-ghost:hover { --btn-bg: rgba(230, 222, 208, .5); }
  .btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
  .btn-danger:hover { --btn-bg: #96322a; }
  .btn-danger-soft { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-bd: transparent; }
  .btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
  .btn-lg { height: 48px; padding: 0 24px; font-size: 15px; }
  .btn-block { width: 100%; }
  .btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--r-full); color: var(--ink-2); }
  .btn-icon:hover { background: rgba(230, 222, 208, .55); }
  .btn-icon.sm { width: 30px; height: 30px; }

  .card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
  }
  .card-pad { padding: 20px; }
  .card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
  .card-head h2, .card-head h3 { font-size: 16px; }
  .card-head .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

  .section { margin-top: 34px; }
  .section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
  .section-head h2 { font-size: 18px; }
  .section-head .actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

  .chip {
    display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 10px;
    border-radius: var(--r-full);
    background: var(--surface-2); border: 1px solid var(--line);
    font-size: 11.5px; font-weight: 600; color: var(--ink-2);
    white-space: nowrap;
  }
  .chip svg { opacity: .7; }
  .chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
  .chip.green { background: var(--green-soft); border-color: transparent; color: var(--green); }
  .chip.blue { background: var(--blue-soft); border-color: transparent; color: var(--blue); }
  .chip.amber { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
  .chip.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
  .chip.muted { color: var(--muted); }
  .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

  .filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .seg {
    display: inline-flex; padding: 3px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-full);
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .seg::-webkit-scrollbar { display: none; }
  .seg button {
    height: 30px; padding: 0 14px; border-radius: var(--r-full);
    font-size: 12.5px; font-weight: 600; color: var(--muted);
    white-space: nowrap; flex: 0 0 auto;
  }
  .seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

  .select, .input, .textarea {
    width: 100%; min-height: 42px; padding: 10px 13px;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line-strong); border-radius: var(--r-md);
    font-size: 14px;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
  }
  .select:focus, .input:focus, .textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(180, 85, 47, .14);
    background: #fffefb;
  }
  .textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
  .select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7e70' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    padding-right: 34px;
  }
  .field { display: flex; flex-direction: column; gap: 7px; }
  .field > label, .field > .label {
    font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em;
    display: flex; align-items: center; gap: 6px;
  }
  .field .hint { font-size: 11.5px; color: var(--muted); }
  .field .err { font-size: 11.5px; color: var(--danger); }
  .input.is-invalid, .textarea.is-invalid, .select.is-invalid { border-color: var(--danger); }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

  textarea.serif { font-family: var(--font-serif); font-size: 16px; line-height: 1.9; }

  .empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 46px 24px; text-align: center;
    border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
    background: rgba(255, 253, 248, .55);
  }
  .empty .icon-wrap {
    width: 52px; height: 52px; border-radius: var(--r-full);
    display: grid; place-items: center;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  }
  .empty h3 { font-size: 16px; }
  .empty p { font-size: 13px; color: var(--muted); max-width: 340px; }

  .stat {
    display: flex; flex-direction: column; gap: 2px;
    padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  }
  .stat b { font-family: var(--font-serif); font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .stat span { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
  .stat.tint { background: linear-gradient(160deg, var(--surface), var(--accent-softer)); }

  .divider { height: 1px; background: var(--line); border: 0; margin: 0; }

  /* modal */
  .modal-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
  .modal-scrim {
    position: fixed; inset: 0; background: rgba(36, 31, 26, .42);
    backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s var(--ease);
    pointer-events: auto;
  }
  .modal-scrim.is-open { opacity: 1; }
  .modal-sheet {
    position: fixed; z-index: 101; pointer-events: auto;
    left: 50%; top: 50%; translate: -50% -46%;
    width: min(520px, calc(100vw - 32px));
    max-height: min(86dvh, 860px);
    display: flex; flex-direction: column;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    opacity: 0; transition: opacity .22s var(--ease), translate .26s var(--ease);
    overflow: hidden;
  }
  .modal-sheet.is-open { opacity: 1; translate: -50% -50%; }
  .modal-sheet.wide { width: min(880px, calc(100vw - 40px)); }
  .modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
  .modal-head h3 { font-family: var(--font-serif); font-size: 17px; }
  .modal-head .close { margin-left: auto; }
  .modal-body { padding: 4px 20px 8px; overflow: auto; }
  .modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px 18px; flex-wrap: wrap; }
  .modal-foot .grow { margin-right: auto; }

  /* toast */
  .toast-root {
    position: fixed; z-index: 200; bottom: 22px; left: 50%; translate: -50% 0;
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none; width: min(520px, calc(100vw - 32px));
  }
  .toast {
    display: flex; align-items: center; gap: 9px;
    max-width: 100%;
    padding: 10px 16px;
    border-radius: var(--r-full);
    background: rgba(36, 31, 26, .94);
    color: #f7f1e7; font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-md);
    animation: toast-in .26s var(--ease);
  }
  .toast svg { flex: 0 0 auto; opacity: .85; }
  .toast.ok svg { color: #8fd0ac; }
  .toast.err svg { color: #f3a79a; }
  .toast.is-out { animation: toast-out .22s var(--ease) forwards; }
  @keyframes toast-in { from { opacity: 0; translate: 0 10px; } }
  @keyframes toast-out { to { opacity: 0; translate: 0 8px; } }

  /* lightbox */
  .lightbox {
    position: fixed; inset: 0; z-index: 150;
    display: grid; place-items: center;
    background: rgba(20, 17, 14, .93);
    padding: 24px;
    animation: fade-in .2s var(--ease);
  }
  .lightbox img { max-width: 100%; max-height: calc(100dvh - 80px); border-radius: var(--r-sm); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
  .lightbox .lb-close { position: fixed; top: 18px; right: 18px; color: #f4efe6; }
  .lightbox .lb-cap { position: fixed; bottom: 20px; left: 50%; translate: -50% 0; color: #d8d0c4; font-size: 12.5px; text-align: center; }
  @keyframes fade-in { from { opacity: 0; } }

  /* photo tiles */
  .thumb {
    position: relative; overflow: hidden; border-radius: var(--r-md);
    background: linear-gradient(140deg, #efe6d8, #e3d6c3);
    aspect-ratio: 1; display: block; width: 100%;
  }
  .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
  .thumb:hover img { transform: scale(1.04); }
  .thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #b7a894; }

  .sync-badge {
    position: absolute; left: 8px; bottom: 8px;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: var(--r-full);
    font-size: 10.5px; font-weight: 600;
    background: rgba(36, 31, 26, .72); color: #f4ece0;
    backdrop-filter: blur(4px);
  }
  .sync-badge.done { background: rgba(60, 110, 88, .82); }
  .sync-badge.fail { background: rgba(168, 58, 46, .86); }
  .sync-badge.wait { background: rgba(169, 116, 31, .86); }

  .progress { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
  .progress > i { display: block; height: 100%; background: var(--accent); transition: width .25s linear; }

  /* 表单底部操作条 */
  .form-actions {
    margin: 6px -20px -20px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    gap: 10px;
  }
}

/* ------------------------------------------------------------------- views */
@layer views {
  /* ---------- auth ---------- */
  .auth {
    min-height: 100dvh;
    display: grid; grid-template-columns: 1.05fr .95fr;
  }
  .auth-art {
    position: relative; overflow: hidden;
    padding: 44px;
    display: flex; flex-direction: column; justify-content: space-between;
    color: #fbf5ec;
    background:
      radial-gradient(760px 420px at 18% 12%, rgba(233, 168, 122, .5), transparent 62%),
      radial-gradient(620px 520px at 88% 86%, rgba(94, 130, 112, .5), transparent 64%),
      linear-gradient(160deg, #4a3327 0%, #2f211a 52%, #23201c 100%);
  }
  .auth-art::after {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
    background-size: 5px 5px; opacity: .5; pointer-events: none;
  }
  .auth-art .quote { max-width: 460px; position: relative; z-index: 1; }
  .auth-art .quote h2 { font-family: var(--font-serif); font-size: clamp(26px, 3vw, 40px); line-height: 1.35; font-weight: 500; white-space: pre-line; }
  .auth-art .quote p { margin-top: 16px; color: #d6c7b8; font-size: 13.5px; max-width: 360px; }
  .auth-art .stamp {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #c9b7a4;
  }
  .auth-art .polaroids { position: relative; z-index: 1; display: flex; gap: 12px; margin-top: 26px; }
  .auth-art .polaroid {
    width: 108px; height: 132px; border-radius: 6px; padding: 7px 7px 18px;
    background: #f7f0e4; box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .7);
    transform: rotate(-4deg);
  }
  .auth-art .polaroid:nth-child(2) { transform: rotate(3deg) translateY(-8px); }
  .auth-art .polaroid:nth-child(3) { transform: rotate(-1.5deg) translateY(4px); }
  .auth-art .polaroid .fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(150deg, #e8b48c, #a8644a 60%, #6c4636);
  }
  .auth-art .polaroid:nth-child(2) .fill { background: linear-gradient(150deg, #a9c3b1, #587a68 55%, #3c5748); }
  .auth-art .polaroid:nth-child(3) .fill { background: linear-gradient(150deg, #cfd6e0, #7c8da0 60%, #4d5b6b); }

  .auth-panel { display: grid; place-items: center; padding: 40px 24px; }
  .auth-card { width: 100%; max-width: 384px; }
  .auth-card .brand { padding: 0 0 26px; }
  .auth-card h1 { font-size: 27px; }
  .auth-card .sub { color: var(--muted); font-size: 13.5px; margin-top: 7px; }
  .auth-form { display: flex; flex-direction: column; gap: 15px; margin-top: 24px; }
  .auth-alt { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }
  .link { color: var(--accent-ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(180, 85, 47, .3); }
  .link:hover { border-bottom-color: var(--accent); }
  .card table a.link { display: inline-block; padding: 7px 2px; }
  .auth-note {
    margin-top: 20px; padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--accent-softer); border: 1px dashed #e9cbb8;
    font-size: 11.5px; color: #8a5334; line-height: 1.6;
  }
  .pw-toggle { position: absolute; right: 6px; top: 50%; translate: 0 -50%; }
  .input-wrap { position: relative; }

  /* ---------- hero ---------- */
  .hero {
    position: relative; overflow: hidden;
    border-radius: var(--r-xl);
    min-height: 232px;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 26px 28px;
    color: #fdf7ef;
    border: 1px solid rgba(36, 31, 26, .1);
    box-shadow: var(--shadow-md);
  }
  .hero .bg { position: absolute; inset: 0; z-index: 0; }
  .hero .bg img { width: 100%; height: 100%; object-fit: cover; }
  .hero .scrim {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(180deg, rgba(24, 19, 15, .12) 0%, rgba(24, 19, 15, .52) 58%, rgba(24, 19, 15, .84) 100%);
  }
  .hero .inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
  .hero h1 { font-size: clamp(24px, 3vw, 34px); text-shadow: 0 2px 18px rgba(0, 0, 0, .3); }
  .hero .meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: #e8dbcb; }
  .hero .meta .chip { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .18); color: #f6ede2; backdrop-filter: blur(6px); }
  .hero .hero-actions { position: absolute; top: 18px; right: 18px; z-index: 3; display: flex; gap: 8px; }
  .hero .hero-actions .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .26); color: #fff; backdrop-filter: blur(8px); }
  .hero .hero-actions .btn:hover { background: rgba(255, 255, 255, .26); }

  .greeting { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
  .greeting h1 { font-size: clamp(24px, 3vw, 32px); }
  .greeting p { color: var(--muted); font-size: 13px; margin-top: 5px; }

  .quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .quick {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    text-align: left;
    transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
  }
  .quick:hover { border-color: #dcc9b6; transform: translateY(-1px); box-shadow: var(--shadow-md); }
  .quick .ico {
    width: 34px; height: 34px; border-radius: var(--r-sm);
    display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-ink);
  }
  .quick.accent { background: linear-gradient(155deg, #c2603f, #9c4423); border-color: transparent; color: #fff6ee; }
  .quick.accent .ico { background: rgba(255, 255, 255, .18); color: #fff; }
  .quick b { font-size: 13.5px; font-weight: 600; }
  .quick span { font-size: 11.5px; opacity: .78; }
  .quick.accent span { opacity: .95; color: #ffe7d8; }

  /* ---------- trip cards ---------- */
  .trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 18px; }
  .trip-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
    transition: transform .2s var(--ease), box-shadow .24s var(--ease), border-color .2s var(--ease);
  }
  .trip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #ddcfbd; }
  .trip-cover {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden;
    background: linear-gradient(150deg, #e9dcc9, #d8c5ad);
  }
  .trip-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
  .trip-card:hover .trip-cover img { transform: scale(1.045); }
  .trip-cover .status { position: absolute; top: 10px; left: 10px; }
  .trip-cover .cover-empty {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    color: #a8967c;
    background:
      radial-gradient(120% 100% at 20% 10%, #f6ecdc, #e5d5bd 62%, #d8c3a7 100%);
  }
  .trip-cover .cover-empty svg { opacity: .65; }
  .trip-cover .cover-empty span { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
  .trip-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 6px; }
  .trip-body h3 { font-size: 16px; font-family: var(--font-serif); }
  .trip-body .where { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
  .trip-body .when { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
  .trip-body .counts { display: flex; gap: 12px; margin-top: 4px; font-size: 11.5px; color: var(--ink-2); }
  .trip-body .counts span { display: inline-flex; align-items: center; gap: 4px; }

  .status-pill {
    display: inline-flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 9px; border-radius: var(--r-full);
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    backdrop-filter: blur(6px);
  }
  .status-planned { background: rgba(62, 92, 118, .88); color: #eef4f9; }
  .status-active { background: rgba(60, 110, 88, .9); color: #eef7f1; }
  .status-done { background: rgba(60, 54, 46, .78); color: #efe7db; }

  /* ---------- trip detail ---------- */
  .cover-hero {
    position: relative; overflow: hidden;
    border-radius: var(--r-xl);
    min-height: 300px;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 30px 32px;
    color: #fdf7ef;
    background: linear-gradient(150deg, #4b3628, #2c211a);
    box-shadow: var(--shadow-md);
    margin-bottom: 22px;
  }
  .cover-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .cover-watermark {
    position: absolute; inset: 0; display: grid; place-items: center;
    color: rgba(255, 255, 255, .13);
    background:
      radial-gradient(90% 80% at 20% 15%, rgba(180, 85, 47, .5), transparent 60%),
      radial-gradient(70% 70% at 85% 80%, rgba(60, 110, 88, .42), transparent 62%);
  }
  .cover-hero .scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(20, 16, 12, .1) 0%, rgba(20, 16, 12, .45) 55%, rgba(20, 16, 12, .86) 100%);
  }
  .cover-hero .inner { position: relative; display: flex; flex-direction: column; gap: 10px; }
  .cover-hero .kicker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .cover-hero h1 { font-size: clamp(26px, 3.6vw, 42px); text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
  .cover-hero .sub { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #e6d8c8; }
  .cover-hero .sub span { display: inline-flex; align-items: center; gap: 6px; }
  .cover-hero .desc { max-width: 640px; font-size: 13px; color: #ddd0c0; line-height: 1.75; }
  .cover-hero .hero-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
  .cover-hero .hero-tools .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); color: #fff; backdrop-filter: blur(8px); }
  .cover-hero .hero-tools .btn:hover { background: rgba(255, 255, 255, .24); }

  .detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }

  /* photo grid */
  .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
  .photo-grid.dense { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
  .photo-grid .thumb { border-radius: var(--r-sm); }

  .photo-card { display: flex; flex-direction: column; gap: 7px; text-decoration: none; color: inherit; min-width: 0; }
  .photo-card .cap { font-size: 12px; color: var(--ink-2); }
  .photo-card .cap b { display: block; font-weight: 600; font-size: 12.5px; }
  .photo-card .cap span { color: var(--muted); font-size: 11px; }

  /* timeline */
  .timeline { position: relative; display: flex; flex-direction: column; gap: 26px; }
  .tl-day { position: relative; padding-left: 26px; }
  .tl-day::before {
    content: ""; position: absolute; left: 5px; top: 26px; bottom: -26px;
    width: 1px; background: linear-gradient(180deg, var(--line-strong), rgba(214, 203, 184, .2));
  }
  .tl-day:last-child::before { display: none; }
  .tl-day > .marker {
    position: absolute; left: 0; top: 7px;
    width: 11px; height: 11px; border-radius: 50%;
    border: 2px solid var(--accent); background: var(--paper);
  }
  .tl-day > .day-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
  .tl-day .day-head b { font-family: var(--font-serif); font-size: 15px; }
  .tl-day .day-head span { font-size: 11.5px; color: var(--muted); }
  .tl-rows { display: flex; flex-direction: column; gap: 10px; }
  .tl-row {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    text-decoration: none; color: inherit;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  }
  .tl-row:hover { border-color: #dcc9b6; box-shadow: var(--shadow-sm); }
  .tl-row .thumb { width: 78px; height: 78px; flex: 0 0 auto; aspect-ratio: auto; border-radius: var(--r-xs); }
  .tl-row .body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .tl-row .body b { font-size: 13.5px; }
  .tl-row .body p { font-size: 12px; color: var(--ink-2); line-height: 1.65; }
  .tl-row .body .where { font-size: 11px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
  .tl-row .time { margin-left: auto; flex: 0 0 auto; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

  /* diary */
  .diary-list { display: flex; flex-direction: column; gap: 12px; }
  .diary-item {
    display: grid; grid-template-columns: 62px 1fr; gap: 16px;
    padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    text-decoration: none; color: inherit;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
  }
  .diary-item:hover { border-color: #dcc9b6; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
  .diary-date { display: flex; flex-direction: column; align-items: center; gap: 0; padding-top: 2px; }
  .diary-date b { font-family: var(--font-serif); font-size: 24px; line-height: 1; }
  .diary-date span { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
  .diary-item .content { min-width: 0; }
  .diary-item h3 { font-size: 15.5px; margin-bottom: 5px; }
  .diary-item p { font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
  .diary-item .foot { display: flex; gap: 10px; align-items: center; margin-top: 9px; flex-wrap: wrap; }
  .diary-thumbs { display: flex; gap: 4px; }
  .diary-thumbs .thumb { width: 30px; height: 30px; border-radius: 5px; aspect-ratio: auto; }

  .diary-read { max-width: 720px; }
  .diary-read h1 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 10px; }
  .diary-read .meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
  .diary-body {
    font-family: var(--font-serif); font-size: 16.5px; line-height: 2.05; color: #2c2620;
    white-space: pre-wrap; word-break: break-word;
  }
  .diary-body img { border-radius: var(--r-md); margin: 14px 0; max-height: 520px; width: auto; }

  /* photo detail */
  .photo-detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr); gap: 26px; align-items: start; }
  .photo-stage {
    border-radius: var(--r-lg); overflow: hidden;
    background: #1d1915; border: 1px solid rgba(0, 0, 0, .2);
    box-shadow: var(--shadow-md);
    position: sticky; top: 78px;
  }
  .photo-stage img { width: 100%; max-height: calc(100dvh - 170px); object-fit: contain; background: #12100d; cursor: zoom-in; }
  .photo-side { display: flex; flex-direction: column; gap: 16px; }
  .meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .meta-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .meta-item .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .meta-item .v { font-size: 13px; }

  /* capture */
  .capture-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 24px; align-items: start; }
  .drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    min-height: 380px; padding: 28px;
    border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
    background: rgba(255, 253, 248, .6);
    text-align: center;
  }
  .drop .ico { width: 58px; height: 58px; border-radius: var(--r-full); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
  .drop h3 { font-size: 16px; }
  .drop p { font-size: 12.5px; color: var(--muted); max-width: 320px; }
  .preview-stage {
    position: relative; border-radius: var(--r-lg); overflow: hidden; background: #17140f;
    border: 1px solid rgba(0, 0, 0, .2);
  }
  .preview-stage img { width: 100%; max-height: 56dvh; object-fit: contain; }
  .preview-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
  .preview-tools .btn { background: rgba(20, 17, 14, .55); border-color: rgba(255, 255, 255, .2); color: #fff; backdrop-filter: blur(8px); }

  .camera { position: fixed; inset: 0; z-index: 160; background: #0d0b09; display: flex; flex-direction: column; }
  .camera video { flex: 1; width: 100%; height: 100%; object-fit: cover; background: #000; }
  .camera .cam-bar { display: flex; align-items: center; justify-content: center; gap: 34px; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); background: #0d0b09; }
  .camera .shutter {
    width: 68px; height: 68px; border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .16);
    transition: transform .12s var(--ease), background .2s var(--ease);
  }
  .camera .shutter:active { transform: scale(.93); background: rgba(255, 255, 255, .4); }
  .camera .cam-hint { position: absolute; top: calc(16px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; color: #e9e1d5; font-size: 12px; text-shadow: 0 1px 6px #000; }
  .camera .cam-err { margin: auto; padding: 30px; text-align: center; color: #e9e1d5; max-width: 380px; }

  /* upload queue */
  .queue { display: flex; flex-direction: column; gap: 8px; }
  .queue-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 12px; }
  .queue-item .bar { flex: 1; min-width: 60px; }
  .queue-item .thumb { width: 34px; height: 34px; border-radius: 5px; aspect-ratio: auto; flex: 0 0 auto; }

  /* settings */
  .settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
  .settings-grid > * { min-width: 0; }
  .settings-grid .card { min-width: 0; }
  .settings-grid .setting-row { flex-wrap: wrap; }
  .settings-grid .setting-row .ctl { flex-wrap: wrap; }
  .settings-grid .setting-row .ctl .select { min-width: 0; }
  .settings-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; }
  .settings-nav a, .settings-nav button { padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px; color: var(--ink-2); text-decoration: none; text-align: left; }
  .settings-nav a:hover, .settings-nav button:hover { background: var(--surface-2); color: var(--ink); }
  .setting-row { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .setting-row:last-child { border-bottom: 0; }
  .setting-row .info { min-width: 0; }
  .setting-row .info b { display: block; font-size: 13.5px; font-weight: 600; }
  .setting-row .info span { font-size: 12px; color: var(--muted); }
  .setting-row .ctl { margin-left: auto; flex: 0 0 auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
  .card table .link { display: inline-block; padding: 6px 2px; }

  .switch { position: relative; width: 46px; height: 28px; flex: 0 0 auto; }
  .switch input { position: absolute; inset: -8px; width: auto; height: auto; margin: 0; opacity: 0; cursor: pointer; }
  .switch .track { position: absolute; inset: 0; border-radius: var(--r-full); background: var(--line-strong); transition: background .18s var(--ease); }
  .switch .track::after {
    content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: translate .18s var(--ease);
  }
  .switch input:checked + .track { background: var(--green); }
  .switch input:checked + .track::after { translate: 18px 0; }

  .bar-chart { display: flex; align-items: flex-end; justify-content: flex-start; gap: 8px; height: 150px; padding-top: 10px; }
  .bar-col { flex: 0 1 54px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
  .bar-col .bar { width: 100%; max-width: 34px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #c46a44, #a94b28); min-height: 3px; transition: height .5s var(--ease); }
  .bar-col span { font-size: 10px; color: var(--muted); white-space: nowrap; }
  .bar-col b { font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

  .loc-list { display: flex; flex-direction: column; gap: 2px; }
  .loc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .loc-row:last-child { border-bottom: 0; }
  .loc-row .bar { height: 5px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; }
  .loc-row .bar > i { display: block; height: 100%; background: var(--accent); }

  /* banner for external change */
  .sync-banner {
    position: sticky; top: 66px; z-index: 30;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; margin-bottom: 12px;
    border-radius: var(--r-full);
    background: #fdf3e7; border: 1px solid #ecd3ba; color: #7c4a2a;
    font-size: 12.5px;
    box-shadow: var(--shadow-sm);
  }
  .sync-banner .btn { margin-left: auto; }

  .draft-note { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--amber); }

  .trash-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .trash-row:last-child { border-bottom: 0; }
  .trash-row .thumb { width: 46px; height: 46px; aspect-ratio: auto; flex: 0 0 auto; }

  .code-input { letter-spacing: .5em; font-size: 18px; text-align: center; font-family: var(--font-sans); }
}

/* --------------------------------------------------------------- responsive */
@layer responsive {
  @media (max-width: 1080px) {
    .photo-detail { grid-template-columns: 1fr; }
    .photo-stage { position: static; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-nav { display: none; }
  }

  @media (max-width: 960px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main { padding: 0 14px calc(88px + env(safe-area-inset-bottom)); }
    .view { padding-top: 8px; }
    .topbar { padding: 10px 0 10px; gap: 10px; }
    .topbar .search kbd { display: none; }
    .topbar .btn-primary { display: none; }
    .hero .hero-actions, .cover-hero .hero-tools { position: static; align-self: flex-end; margin-bottom: 8px; }
    .hero { padding-top: 16px; }
    .cover-hero { padding-top: 16px; }
    .auth-art .quote h2 { font-size: 24px; }
    .mobilebar {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      align-items: center;
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
      padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
      background: rgba(253, 250, 244, .96);
      border-top: 1px solid var(--line);
      backdrop-filter: blur(14px);
    }
    .mb-item {
      display: flex; flex-direction: column; align-items: center; gap: 2px;
      padding: 6px 0; border-radius: var(--r-sm);
      color: var(--muted); font-size: 10.5px; text-decoration: none; font-weight: 600;
    }
    .mb-item.is-active { color: var(--accent-ink); }
    .mb-item svg { width: 21px; height: 21px; }
    .mb-record { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
    .mb-record .ring {
      width: 46px; height: 46px; margin-top: -18px;
      border-radius: 50%;
      display: grid; place-items: center;
      background: linear-gradient(150deg, #c4643c, #9c4423);
      color: #fff7ef;
      border: 3px solid var(--paper-2);
      box-shadow: 0 8px 18px -8px rgba(142, 63, 33, .9);
    }
    .mb-record span { font-size: 10.5px; font-weight: 700; color: var(--accent-ink); }
    .hero { min-height: 200px; padding: 20px; }
    .cover-hero { min-height: 240px; padding: 22px; border-radius: var(--r-lg); }
    .detail-stats { grid-template-columns: repeat(2, 1fr); }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
    .capture-layout { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: 1fr 1fr; }
    .quick-grid .quick:first-child { grid-column: 1 / -1; flex-direction: row; align-items: center; }
    .modal-sheet { top: auto; bottom: 0; translate: 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; }
    .modal-sheet.is-open { translate: 0 0; }
    .form-actions {
      position: sticky;
      bottom: calc(66px + env(safe-area-inset-bottom));
      z-index: 5;
      margin: 6px -16px -16px;
      padding: 10px 16px;
      border-radius: var(--r-md);
      box-shadow: 0 -12px 20px -16px rgba(36, 31, 26, .4);
    }
    .toast-root { bottom: calc(84px + env(safe-area-inset-bottom)); }
    .auth { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-panel { padding: 28px 20px 40px; align-items: start; }
    .auth-card { max-width: 100%; margin: 0 auto; }
    .photo-detail { gap: 18px; }
    .timeline .tl-row .thumb { width: 62px; height: 62px; }
    .diary-item { grid-template-columns: 50px 1fr; gap: 12px; padding: 14px; }
    .diary-date b { font-size: 21px; }
  }

  @media (max-width: 560px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .seg button { padding: 0 10px; font-size: 12px; }
    .settings-grid .setting-row .ctl { margin-left: 0; width: 100%; justify-content: flex-start; }
    .settings-grid .setting-row .ctl .select { flex: 1 1 150px; width: auto !important; }
    .settings-grid .setting-row .ctl .btn { flex: 0 1 auto; }
    .trip-grid { grid-template-columns: 1fr; gap: 14px; }
    .page-head { margin-bottom: 18px; }
    .page-head .actions { margin-left: 0; width: 100%; }
    .hero h1 { font-size: 23px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
    .photo-grid.dense { grid-template-columns: repeat(4, 1fr); }
    .modal-foot { padding: 12px 16px 16px; }
    .modal-foot .btn { flex: 1 1 auto; }
    .topbar .search { max-width: none; }
    .detail-stats { gap: 8px; }
    .stat { padding: 13px 14px; }
    .stat b { font-size: 22px; }
    .capture-layout .drop { min-height: 260px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  }
}

@media print {
  .sidebar, .mobilebar, .topbar, .hero-tools, .btn { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
