:root {
  color-scheme: light;
  --ink: #1f2d27;
  --ink-soft: #56635d;
  --ink-faint: #69746f;
  --paper: #f7f4ed;
  --paper-deep: #eee9de;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --line: #e5dfd3;
  --line-strong: #d6cdbf;
  --green: #365e50;
  --green-deep: #294a3f;
  --green-soft: #dfe9e2;
  --terracotta: #be6d4e;
  --terracotta-soft: #f3e3da;
  --gold: #d5aa5b;
  --danger: #a94e49;
  --danger-soft: #f7e5e3;
  --shadow-sm: 0 1px 2px rgba(31, 45, 39, .05), 0 8px 24px rgba(31, 45, 39, .04);
  --shadow-md: 0 20px 50px rgba(31, 45, 39, .10);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 238px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: #c9d9d0; color: var(--ink); }
:focus-visible { outline: 3px solid rgba(190, 109, 78, .34); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: var(--sidebar); flex-direction: column; border-right: 1px solid rgba(255,255,255,.08); background: var(--ink); color: #eef3ef; padding: 24px 18px 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid rgba(255,255,255,.28); border-radius: 13px; background: linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.04)); color: #fff7e9; font-family: Georgia, "Songti SC", serif; font-size: 21px; box-shadow: inset 0 1px rgba(255,255,255,.14); }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 19px; letter-spacing: .12em; }
.brand-copy small { margin-top: 5px; color: #9daaa4; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.main-nav { display: grid; gap: 7px; margin-top: 43px; }
.nav-link { display: flex; align-items: center; gap: 13px; min-height: 46px; padding: 0 13px; border: 1px solid transparent; border-radius: 12px; color: #abb7b1; font-weight: 650; transition: .18s ease; }
.nav-link:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-link.is-active { border-color: rgba(255,255,255,.08); background: #354a41; color: #fff; box-shadow: inset 3px 0 var(--gold); }
.nav-icon { width: 22px; color: #cbd6d0; font-size: 20px; text-align: center; }
.sidebar-foot { display: grid; gap: 12px; margin-top: auto; }
.privacy-note { display: flex; align-items: center; gap: 8px; color: #8f9d96; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #77a889; box-shadow: 0 0 0 4px rgba(119,168,137,.12); }
.profile-chip { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid rgba(255,255,255,.08); border-radius: 13px; background: rgba(255,255,255,.04); }
.profile-chip:hover { background: rgba(255,255,255,.08); }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: #d9bd87; color: #263a31; font-weight: 800; }
.profile-chip > span:last-child { display: grid; min-width: 0; }
.profile-chip strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.profile-chip small { color: #91a099; font-size: 11px; }
.link-button { width: 100%; border: 0; background: transparent; color: #8f9d96; cursor: pointer; font-size: 12px; text-align: left; }
.link-button:hover { color: #fff; }
.main-content { min-height: 100vh; margin-left: var(--sidebar); padding: 34px clamp(28px, 4vw, 58px) 64px; }
.mobile-header, .bottom-nav { display: none; }
.content-frame { width: min(100%, 1380px); margin: 0 auto; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 9px 13px; border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-md); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--terracotta); font-size: 11px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-family: Georgia, "Songti SC", serif; font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -.025em; line-height: 1.12; }
h2 { margin-bottom: 8px; font-size: 20px; letter-spacing: -.015em; }
h3 { margin-bottom: 6px; font-size: 16px; }
.page-subtitle { margin: 0; color: var(--ink-soft); }
.heading-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 750; line-height: 1; transition: transform .14s ease, background .14s ease, border-color .14s ease; }
.button:hover { border-color: #bcb1a1; background: #fff; transform: translateY(-1px); }
.button-primary { border-color: var(--green); background: var(--green); color: #fff; box-shadow: 0 8px 18px rgba(54,94,80,.17); }
.button-primary:hover { border-color: var(--green-deep); background: var(--green-deep); }
.button-secondary { background: var(--paper-deep); }
.button-danger { border-color: #d8aaa6; background: var(--danger-soft); color: var(--danger); }
.button-small { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: 13px; }
.button-quiet { border-color: transparent; background: transparent; box-shadow: none; }
.button-block { width: 100%; }
.button[disabled] { cursor: not-allowed; opacity: .55; transform: none; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { margin: 0; }
.panel-body { padding: 22px; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.divider { height: 1px; margin: 22px 0; background: var(--line); }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); gap: 24px; min-height: 260px; padding: clamp(28px, 4vw, 48px); border-radius: var(--radius-lg); background: linear-gradient(126deg, #24382f 0%, #355449 66%, #526c5f 100%); color: #f9f6ee; box-shadow: var(--shadow-md); }
.hero::after { position: absolute; right: -70px; bottom: -135px; width: 310px; height: 310px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.035), 0 0 0 80px rgba(255,255,255,.025); content: ""; }
.hero-copy { position: relative; z-index: 1; align-self: center; }
.hero .eyebrow { color: #d9bd87; }
.hero h1 { max-width: 720px; margin-bottom: 13px; font-size: clamp(32px, 4.2vw, 52px); }
.hero p { max-width: 650px; color: #c9d5cf; }
.hero-search { display: flex; max-width: 650px; margin-top: 24px; padding: 6px; border: 1px solid rgba(255,255,255,.17); border-radius: 14px; background: rgba(255,255,255,.10); backdrop-filter: blur(10px); }
.hero-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #fff; padding: 8px 11px; }
.hero-search input::placeholder { color: #adbbb4; }
.hero-search .button { border: 0; background: #f4eee1; color: var(--ink); box-shadow: none; }
.hero-aside { position: relative; z-index: 1; align-self: end; padding: 20px; border: 1px solid rgba(255,255,255,.13); border-radius: 17px; background: rgba(17,31,25,.25); backdrop-filter: blur(8px); }
.hero-aside small { color: #acbbb3; }
.hero-aside strong { display: block; margin: 5px 0 8px; font-family: Georgia, serif; font-size: 32px; font-weight: 500; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0 26px; }
.metric-card { min-width: 0; padding: 19px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card-head { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.metric-value { display: block; overflow: hidden; margin-top: 12px; font-family: Georgia, "Songti SC", serif; font-size: 29px; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.025em; text-overflow: ellipsis; }
.metric-note { margin: 4px 0 0; color: var(--ink-faint); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 18px; }
.recent-list { display: grid; }
.recent-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: 0; }
.thumb { position: relative; overflow: hidden; display: grid; width: 54px; height: 54px; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #e8e2d6, #d9e2db); color: #60736a; font-family: Georgia, serif; font-size: 20px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-main { min-width: 0; }
.recent-main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-meta { color: var(--ink-faint); font-size: 12px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-lent { background: #eee7d9; color: #866b36; }
.status-repair { background: var(--terracotta-soft); color: #9b5a41; }
.status-disposed { background: #ecebea; color: #717672; }
.activity-list { display: grid; gap: 16px; }
.activity-item { display: grid; grid-template-columns: 9px minmax(0,1fr); gap: 12px; }
.activity-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--terracotta); box-shadow: 0 0 0 4px var(--terracotta-soft); }
.activity-item p { margin: 0; font-size: 13px; }
.activity-item time { color: var(--ink-faint); font-size: 11px; }
.usage-bars { display: flex; height: 86px; align-items: flex-end; gap: 5px; margin-top: 18px; }
.usage-bar { min-width: 4px; flex: 1; border-radius: 4px 4px 2px 2px; background: #8da79b; opacity: .85; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-box { position: relative; min-width: min(100%, 330px); flex: 1; }
.search-box input { width: 100%; padding-left: 39px; }
.search-box::before { position: absolute; top: 50%; left: 14px; color: var(--ink-faint); content: "⌕"; font-size: 20px; transform: translateY(-53%); }
.filter-select { min-width: 140px; }
.filter-controls { display: contents; }
.filter-controls-header, .mobile-filter-toggle, .mobile-filter-apply, .filter-backdrop, .active-filter-chips { display: none; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], select, textarea { width: 100%; min-height: 43px; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; background: var(--surface-strong); padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 112px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #769487; box-shadow: 0 0 0 3px rgba(90,129,111,.12); }
input::placeholder, textarea::placeholder { color: #a1a7a3; }
.item-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; }
.item-card { position: relative; overflow: hidden; display: grid; grid-template-columns: 116px minmax(0,1fr); min-height: 142px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, border-color .16s; }
.item-card:hover { border-color: #cfc5b7; box-shadow: 0 14px 34px rgba(31,45,39,.08); transform: translateY(-2px); }
.item-card { content-visibility: auto; contain-intrinsic-size: 142px; }
.item-photo { position: relative; overflow: hidden; display: grid; min-height: 142px; place-items: center; background: linear-gradient(145deg, #e5e0d4, #dae5de); color: #60736a; font-family: Georgia, serif; font-size: 30px; }
.item-photo img { width: 100%; height: 100%; object-fit: cover; }
.image-shell-loading { position: relative; overflow: hidden; background: #e8e5dc; }
.image-shell-loading img { opacity: 0; }
.image-shell-loading::after { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.58) 42%, transparent 64%); content: ""; animation: skeleton-sweep 1.25s ease-in-out infinite; transform: translateX(-100%); }
.image-shell-loaded img { opacity: 1; transition: opacity .2s ease; }
@keyframes skeleton-sweep { to { transform: translateX(100%); } }
.item-card-body { min-width: 0; padding: 16px 15px; }
.item-card-top { display: flex; justify-content: space-between; gap: 8px; }
.item-card h3 { overflow: hidden; margin-bottom: 3px; text-overflow: ellipsis; white-space: nowrap; }
.asset-code { color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.item-card-meta { display: grid; gap: 5px; margin-top: 13px; color: var(--ink-soft); font-size: 12px; }
.item-card-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite { color: var(--gold); }
.card-check { position: absolute; z-index: 2; top: 9px; left: 9px; display: none; width: 19px; height: 19px; accent-color: var(--green); }
.selection-tools { display: none; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--ink-soft); font-size: 12px; }
[data-bulk-form].is-selecting .card-check { display: block; }
[data-bulk-form].is-selecting .selection-tools { display: flex; }
.bulk-bar { position: fixed; z-index: 40; bottom: 18px; left: calc(var(--sidebar) + (100vw - var(--sidebar)) / 2); display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(720px, calc(100% - var(--sidebar) - 40px)); margin: 0; padding: 11px 13px 11px 18px; border: 1px solid rgba(255,255,255,.16); border-radius: 15px; background: #263a31; color: #fff; box-shadow: 0 16px 40px rgba(31,45,39,.26); transform: translateX(-50%); }
.bulk-actions { display: flex; gap: 7px; }
.bulk-bar select { width: auto; min-height: 36px; border-color: rgba(255,255,255,.16); background: #354b41; color: #fff; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; color: var(--ink-soft); }

.empty-state { padding: clamp(38px, 8vw, 78px) 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: rgba(255,253,248,.55); text-align: center; }
.empty-symbol { display: grid; width: 62px; height: 62px; margin: 0 auto 18px; place-items: center; border-radius: 20px; background: var(--green-soft); color: var(--green); font-family: Georgia, serif; font-size: 28px; transform: rotate(-4deg); }
.empty-state p { max-width: 460px; margin: 0 auto 22px; color: var(--ink-soft); }

.form-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); align-items: start; gap: 18px; }
.form-section { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.form-section + .form-section { margin-top: 16px; }
.section-intro { margin-bottom: 19px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.section-intro p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.field-grid-three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { display: grid; gap: 7px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label, .field-label { color: #3f4e47; font-size: 12px; font-weight: 800; }
.field-hint { color: var(--ink-faint); font-size: 11px; }
.field-error, .validation-summary-errors { color: var(--danger); font-size: 12px; }
.validation-summary-errors ul { margin: 0; padding-left: 18px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; top: 50%; left: 50%; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; transform: translate(-50%, -50%); }
.check-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-strong); color: var(--ink-soft); cursor: pointer; font-size: 12px; font-weight: 700; }
.check-chip input:checked + span { border-color: #87a597; background: var(--green-soft); color: var(--green-deep); }
.check-chip:focus-within > span { outline: 3px solid rgba(190,109,78,.34); outline-offset: 2px; }
.color-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dot, #557568); }
.form-sticky { position: sticky; top: 24px; }
.save-card { padding: 20px; }
.save-card .button + .button { margin-top: 9px; }
.upload-zone { position: relative; padding: 30px 18px; border: 1.5px dashed #bcb3a5; border-radius: 14px; background: #faf8f2; text-align: center; transition: .16s; }
.upload-zone:focus-within { border-color: #769487; box-shadow: 0 0 0 3px rgba(90,129,111,.14); }
.upload-zone.is-dragging { border-color: var(--green); background: var(--green-soft); transform: scale(1.01); }
.upload-zone.is-processing::after { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; background: rgba(255,255,255,.82); color: var(--green); content: "正在压缩图片…"; font-weight: 800; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone label { cursor: pointer; }
.upload-zone strong { display: block; margin-bottom: 4px; }
.upload-previews, .image-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 12px; }
.upload-preview { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.upload-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.upload-preview figcaption { overflow: hidden; padding: 5px 7px; color: var(--ink-faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.existing-image { position: relative; overflow: hidden; border-radius: 12px; background: var(--paper-deep); }
.existing-image img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.image-actions { position: absolute; inset: auto 6px 6px; display: flex; justify-content: flex-end; gap: 5px; }
.image-actions button { border: 0; border-radius: 8px; background: rgba(31,45,39,.82); color: #fff; cursor: pointer; padding: 5px 7px; font-size: 10px; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .6fr); align-items: start; gap: 18px; }
.detail-hero { overflow: hidden; }
.detail-cover { position: relative; min-height: 360px; background: linear-gradient(145deg, #e3ddd0, #d5e1da); }
.detail-cover img { width: 100%; height: 100%; max-height: 560px; object-fit: cover; }
.detail-placeholder { display: grid; min-height: 360px; place-items: center; color: #63776d; font-family: Georgia, serif; font-size: 72px; }
.detail-body { padding: 25px; }
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.detail-status-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.detail-badge-divider { color: var(--line-strong, #cfc8bc); font-size: 13px; }
.detail-tag-badge { border-color: color-mix(in srgb, var(--tag-color, var(--green)) 38%, var(--line)); background: color-mix(in srgb, var(--tag-color, var(--green)) 12%, var(--surface)); color: color-mix(in srgb, var(--tag-color, var(--green-deep)) 70%, var(--ink)); }
.detail-title-row h1 { margin-bottom: 4px; font-size: 34px; }
.detail-description { margin-top: 16px; color: var(--ink-soft); white-space: pre-wrap; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; }
.fact { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fact:nth-child(odd) { padding-right: 16px; }
.fact small { display: block; color: var(--ink-faint); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.fact strong { display: block; margin-top: 3px; font-size: 14px; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 17px minmax(0,1fr); gap: 12px; padding-bottom: 20px; }
.timeline-item:not(:last-child)::before { position: absolute; top: 12px; bottom: 0; left: 5px; width: 1px; background: var(--line-strong); content: ""; }
.timeline-node { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 3px solid var(--surface); border-radius: 50%; background: var(--terracotta); box-shadow: 0 0 0 1px var(--terracotta); }

.tabs { display: flex; gap: 5px; margin-bottom: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-deep); }
.tab { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 13px; font-weight: 800; }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.catalog-grid { display: grid; grid-template-columns: minmax(280px,.6fr) minmax(0,1.4fr); align-items: start; gap: 18px; }
.catalog-form { position: sticky; top: 24px; }
.catalog-list { display: grid; }
.catalog-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.catalog-row:last-child { border: 0; }
.catalog-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.catalog-color { width: 10px; height: 34px; border-radius: 8px; background: var(--dot, #557568); }
.catalog-name strong { display: block; }
.catalog-name small { color: var(--ink-faint); }
.location-depth { display: inline-block; width: calc(var(--depth, 0) * 18px); }
.row-actions { display: flex; gap: 6px; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); align-items: start; gap: 22px; }
.settings-nav { position: sticky; top: 24px; display: grid; gap: 5px; }
.settings-nav a { padding: 10px 12px; border-radius: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.settings-nav a:hover, .settings-nav a.is-active { background: var(--green-soft); color: var(--green-deep); }
.settings-stack { display: grid; gap: 17px; }
.security-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.security-action-card { position: relative; display: grid; min-height: 172px; grid-template-rows: auto 1fr auto; gap: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #fff, var(--paper)); color: var(--ink); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.security-action-card:hover { border-color: #adc0b6; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.security-action-card:focus-visible { outline: 3px solid rgba(54,94,80,.22); outline-offset: 2px; }
.security-action-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--green-soft); color: var(--green-deep); font-family: Georgia, serif; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.security-action-card:nth-child(2) .security-action-mark { background: #f6eedc; color: #77602f; }
.security-action-card:nth-child(3) .security-action-mark { background: var(--terracotta-soft); color: #8d4e38; }
.security-action-copy { align-self: end; }
.security-action-copy strong { display: block; margin-bottom: 5px; font-size: 15px; }
.security-action-copy small { display: block; color: var(--ink-faint); font-size: 11px; line-height: 1.55; }
.security-action-arrow { color: var(--green); font-size: 20px; line-height: 1; }
.security-breadcrumb { display: flex; align-items: center; gap: 7px; margin-bottom: 13px; color: var(--ink-faint); font-size: 12px; font-weight: 700; }
.security-breadcrumb a { color: var(--green); }
.security-breadcrumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
.security-subpage-heading .eyebrow { margin-top: 0; }
.security-workspace { min-width: 0; }
.security-callout { margin-bottom: 18px; }
.security-form { margin-top: 0; }
.security-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.security-secondary-form { margin-top: 10px; }
.security-totp-setup { margin-top: 20px; }
.security-codes-panel { border-color: #c6d6cd; }
.storage-status { display: flex; align-items: center; gap: 14px; padding: 17px; border-radius: 13px; background: var(--green-soft); }
.storage-status.is-error { background: var(--danger-soft); }
.storage-status-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 13px; background: var(--surface); color: var(--green); font-size: 20px; }
.storage-status strong { display: block; }
.storage-status p { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.storage-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.storage-metric { padding: 15px; border-radius: 12px; background: var(--paper); }
.storage-metric small { color: var(--ink-faint); }
.storage-metric strong { display: block; margin-top: 4px; font-family: Georgia, serif; font-size: 22px; }
.callout { padding: 14px 16px; border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; background: #f6eedc; color: #665530; font-size: 12px; }

.toast { position: fixed; z-index: 80; top: 22px; right: 24px; display: flex; max-width: min(420px, calc(100vw - 32px)); align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid #bad0c4; border-radius: 12px; background: #f5fbf7; color: #315c49; box-shadow: var(--shadow-md); animation: toast-in .3s ease both; }
.toast-error { border-color: #e3b7b3; background: #fff6f5; color: var(--danger); }
.toast.is-leaving { animation: toast-out .3s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-9px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-9px); } }

.auth-surface { overflow-x: hidden; background: #203128; }
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, .88fr) minmax(500px, 1.12fr); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 42px; background: var(--paper); }
.auth-card { width: min(100%, 430px); }
.auth-brand { margin-bottom: 52px; color: var(--ink); }
.auth-brand .brand-mark { border-color: #aebdb5; background: var(--green); }
.auth-card h1 { margin-bottom: 10px; font-size: 38px; }
.auth-card > p { margin-bottom: 29px; color: var(--ink-soft); }
.auth-form { display: grid; gap: 17px; }
.auth-form .button { min-height: 48px; margin-top: 4px; }
.auth-note { margin-top: 19px; color: var(--ink-faint); font-size: 11px; text-align: center; }
.auth-visual { position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: clamp(42px, 6vw, 90px); background: radial-gradient(circle at 70% 20%, rgba(213,170,91,.2), transparent 27%), linear-gradient(145deg, #283e34, #17251f); color: #fff; }
.auth-visual::before, .auth-visual::after { position: absolute; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; content: ""; }
.auth-visual::before { top: 9%; right: -8%; width: 520px; height: 520px; box-shadow: 0 0 0 60px rgba(255,255,255,.018), 0 0 0 130px rgba(255,255,255,.012); }
.auth-visual::after { top: 25%; right: 14%; width: 210px; height: 210px; border-color: rgba(213,170,91,.22); }
.auth-quote { position: relative; z-index: 1; max-width: 560px; }
.auth-quote small { color: #d9bd87; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.auth-quote blockquote { margin: 18px 0 15px; font-family: Georgia, "Songti SC", serif; font-size: clamp(30px, 4vw, 50px); line-height: 1.28; }
.auth-quote p { color: #aebdb6; }
.totp-setup { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 24px; align-items: center; }
.qr-frame { padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.secret-key { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--paper); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; word-break: break-all; }
.recovery-list { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 18px 0; }
.recovery-code { padding: 12px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: clamp(11px, 2.4vw, 14px); line-height: 1.65; letter-spacing: .04em; overflow-wrap: anywhere; text-align: center; }
.recovery-remediation-card { width: min(100%, 690px); }
.recovery-remediation-card .auth-brand { margin-bottom: 34px; }
.recovery-remediation-notice { display: flex; align-items: flex-start; gap: 12px; margin: 22px 0 18px; padding: 14px 16px; border: 1px solid #e1cfa6; border-radius: 13px; background: #faf4e5; color: #665530; }
.recovery-remediation-notice > span { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; background: #ead9af; font-family: Georgia, serif; font-weight: 800; }
.recovery-remediation-notice strong, .recovery-remediation-notice small { display: block; }
.recovery-remediation-notice small { margin-top: 3px; line-height: 1.55; }
.recovery-remediation-progress { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 22px; padding: 0; list-style: none; }
.recovery-remediation-progress li { position: relative; display: grid; justify-items: center; gap: 6px; color: var(--ink-faint); font-size: 11px; font-weight: 750; }
.recovery-remediation-progress li:not(:last-child)::after { position: absolute; z-index: 0; top: 15px; left: calc(50% + 18px); width: calc(100% - 36px); height: 1px; background: var(--line-strong); content: ""; }
.recovery-remediation-progress span { position: relative; z-index: 1; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.recovery-remediation-progress .is-current { color: var(--green-deep); }
.recovery-remediation-progress .is-current span { border-color: var(--green); background: var(--green); color: #fff; }
.recovery-remediation-form { gap: 14px; }
.recovery-remediation-step { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.62); }
.recovery-remediation-step legend { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.recovery-remediation-step legend > span:first-child { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green-deep); font-weight: 800; }
.recovery-remediation-step legend strong, .recovery-remediation-step legend small { display: block; }
.recovery-remediation-step legend small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; font-weight: 500; }
.recovery-remediation-totp { margin: 8px 0 16px; grid-template-columns: 170px minmax(0,1fr); gap: 18px; }
.recovery-remediation-code { max-width: 320px; }
.recovery-remediation-logout { margin-top: 15px; text-align: center; }
.recovery-remediation-form[aria-busy="true"] { opacity: .82; }

.sr-only { position: absolute !important; overflow: hidden; width: 1px; height: 1px; padding: 0; border: 0; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 1180px) {
  .item-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid-three { grid-template-columns: repeat(2, 1fr); }
  .security-action-grid { grid-template-columns: 1fr; }
  .security-action-card { min-height: 0; grid-template-columns: auto minmax(0,1fr) auto; grid-template-rows: 1fr; align-items: center; }
  .security-action-copy { align-self: center; }
}

@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .main-content { margin: 0; padding: 76px 18px 94px; }
  .mobile-header { position: fixed; z-index: 30; inset: 0 0 auto; display: flex; height: 62px; align-items: center; justify-content: space-between; padding: 9px 18px; border-bottom: 1px solid var(--line); background: rgba(247,244,237,.92); backdrop-filter: blur(14px); }
  .mobile-actions { display: flex; align-items: center; gap: 4px; }
  .mobile-actions form { margin: 0; }
  .brand-compact { gap: 8px; }
  .brand-compact .brand-mark { width: 35px; height: 35px; flex-basis: 35px; border: 0; background: var(--ink); font-size: 18px; }
  .bottom-nav { position: fixed; z-index: 31; inset: auto 0 0; display: grid; height: 70px; grid-template-columns: repeat(5,1fr); align-items: center; border-top: 1px solid var(--line); background: rgba(255,253,248,.96); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(15px); }
  .bottom-nav a { display: grid; justify-items: center; gap: 2px; color: var(--ink-faint); }
  .bottom-nav a > span { font-size: 20px; line-height: 1; }
  .bottom-nav small { font-size: 9px; font-weight: 750; }
  .bottom-nav a.is-active { color: var(--green); }
  .bottom-nav .bottom-add span { display: grid; width: 39px; height: 39px; margin-top: -21px; place-items: center; border-radius: 14px; background: var(--green); color: #fff; box-shadow: 0 9px 20px rgba(54,94,80,.25); }
  .hero { grid-template-columns: 1fr; }
  .hero-aside { display: none; }
  .dashboard-grid, .form-layout, .detail-layout { grid-template-columns: 1fr; }
  .form-sticky { position: static; }
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-form { position: static; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
  .security-subpage-heading .heading-actions { width: auto; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-main { min-height: 100vh; padding: 28px 22px; }
  .auth-visual { display: none; }
  .bulk-bar { bottom: 82px; left: 50%; width: calc(100% - 26px); }
}

@media (max-width: 650px) {
  body { font-size: 14px; }
  .main-content { padding: 70px 10px 82px; }
  .content-frame { width: 100%; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 16px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .hero { min-height: 232px; padding: 21px 17px; border-radius: 18px; }
  .hero h1 { margin-bottom: 9px; font-size: 30px; }
  .hero p { line-height: 1.45; }
  .hero-search { margin-top: 16px; padding: 5px; }
  .hero-search { align-items: stretch; flex-direction: column; }
  .hero-search .button { min-height: 40px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin: 10px 0 14px; }
  .metric-card { padding: 12px; border-radius: 13px; }
  .metric-value { margin-top: 7px; font-size: 22px; }
  .metric-note { margin-top: 2px; line-height: 1.35; }
  .dashboard-grid { gap: 10px; }
  .panel { border-radius: 14px; }
  .panel-header { gap: 10px; padding: 14px 15px; }
  .panel-body { padding: 15px; }
  .recent-row { gap: 10px; padding: 10px 0; }
  .activity-list { gap: 12px; }
  .item-grid { grid-template-columns: 1fr; }
  .item-card { grid-template-columns: 105px minmax(0,1fr); }
  .toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; gap: 8px; }
  .search-box { min-width: 0; }
  .mobile-filter-toggle { display: inline-flex; padding-inline: 12px; }
  .filter-controls { position: fixed; z-index: 51; right: 0; bottom: 70px; left: 0; display: none; max-height: calc(100dvh - 92px); grid-template-columns: 1fr; gap: 10px; overflow-y: auto; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 20px 20px 0 0; background: var(--surface); box-shadow: 0 -18px 55px rgba(31,45,39,.2); }
  .filter-controls.is-open { display: grid; }
  .filter-controls-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .filter-controls-header > div { display: grid; }
  .filter-controls-header small { color: var(--ink-faint); }
  .filter-select { width: 100%; min-width: 0; min-height: 46px; font-size: 16px; text-overflow: ellipsis; }
  .mobile-filter-apply { display: inline-flex; width: 100%; }
  .filter-backdrop:not([hidden]) { position: fixed; z-index: 50; inset: 0; display: block; border: 0; background: rgba(18,29,24,.42); }
  .active-filter-chips { display: flex; gap: 6px; overflow-x: auto; margin: -5px 0 12px; padding: 2px 1px 4px; scrollbar-width: none; }
  .active-filter-chips span, .active-filter-chips a { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-size: 11px; font-weight: 700; white-space: nowrap; }
  .active-filter-chips a { background: var(--terracotta-soft); color: #8d4e38; }
  .bulk-toggle, .selection-tools, .card-check, .bulk-bar { display: none !important; }
  .mobile-redundant-add { display: none !important; }
  .field-grid, .field-grid-three { grid-template-columns: 1fr; }
  .form-section { padding: 15px; }
  .field-full { grid-column: auto; }
  .facts { grid-template-columns: 1fr; }
  .fact:nth-child(odd) { padding-right: 0; }
  .storage-metrics { grid-template-columns: 1fr; }
  .totp-setup { grid-template-columns: 1fr; }
  .qr-frame { width: 190px; margin: 0 auto; }
  .recovery-list { grid-template-columns: 1fr; }
  .security-action-grid { gap: 8px; }
  .security-action-card { gap: 12px; padding: 13px; border-radius: 12px; }
  .security-action-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 14px; }
  .security-action-copy strong { margin-bottom: 2px; }
  .security-subpage-heading { gap: 9px; }
  .security-subpage-heading .heading-actions { width: 100%; }
  .security-subpage-heading .heading-actions .button { width: 100%; }
  .security-breadcrumb { margin-bottom: 9px; }
  .security-subpage-heading .heading-actions { display: none; }
  .recovery-remediation-card .auth-brand { margin-bottom: 26px; }
  .recovery-remediation-card h1 { font-size: 31px; }
  .recovery-remediation-notice { margin: 17px 0 15px; padding: 12px; }
  .recovery-remediation-progress { margin-bottom: 17px; }
  .recovery-remediation-step { padding: 14px 11px; }
  .recovery-remediation-step legend { align-items: flex-start; }
  .recovery-remediation-totp { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .recovery-remediation-totp .secret-key { text-align: left; }
  .recovery-remediation-code { max-width: none; }
  .security-callout { margin-bottom: 14px; }
  .security-form-actions { display: grid; grid-template-columns: 1fr; }
  .security-form-actions .button { width: 100%; }
  .security-totp-setup { margin-top: 16px; }
  .toast { top: 12px; right: 12px; left: 12px; }
}

/* Password recovery and Tencent SES configuration. */
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-label-row > a { color: var(--green-deep); font-size: 12px; font-weight: 750; }
.recovery-proof-card { max-width: 490px; width: 100%; }
.recovery-enrollment { margin-top: 20px; }
.setup-email-card { width: min(100%, 620px); }
.setup-email-form { margin-top: 20px; }
.template-url { margin-top: 9px; padding: 9px 11px; overflow-wrap: anywhere; border: 1px solid rgba(63,89,76,.16); border-radius: 9px; background: rgba(255,255,255,.68); }
.template-url code { white-space: normal; word-break: break-all; }
.switch-field { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.switch-field > input { width: auto; margin-top: 4px; }
.switch-field > span { display: grid; gap: 3px; }
.switch-field strong, .switch-field small { display: block; }
.switch-field small { color: var(--ink-faint); font-size: 11px; line-height: 1.5; }

@media (max-width: 650px) {
  .setup-email-card .auth-brand { margin-bottom: 28px; }
  .setup-email-card h1, .recovery-proof-card h1 { font-size: 31px; }
  .recovery-enrollment { margin-top: 15px; }
  .template-url { padding: 8px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* Mobile-only, on-device QR and barcode scanner. */
.hero-search-entry { display: flex; min-width: 0; flex: 1; align-items: center; }
.hero-search-entry > input { width: 100%; }
.mobile-scan-trigger { display: none; }
.scanner-open { overflow: hidden; }
.scanner-dialog { width: min(94vw, 520px); max-height: min(88vh, 760px); margin: auto; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 28px 80px rgba(15, 25, 21, .32); }
.scanner-dialog::backdrop { background: rgba(17, 29, 24, .68); backdrop-filter: blur(4px); }
.scanner-sheet { display: grid; max-height: min(88vh, 760px); overflow-y: auto; padding: 20px; gap: 14px; overscroll-behavior: contain; }
.scanner-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.scanner-header h2 { margin: 0; }
.scanner-header .eyebrow { margin-bottom: 4px; }
.scanner-close { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--ink-soft); cursor: pointer; font-size: 25px; line-height: 1; }
.scanner-close:hover { border-color: var(--line-strong); color: var(--ink); }
.scanner-privacy { margin: 0; padding: 11px 13px; border-radius: 11px; background: var(--green-soft); color: var(--green-deep); font-size: 13px; }
.scanner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.scanner-actions .button { min-width: 0; padding-inline: 12px; }
.scanner-file-input { position: fixed; overflow: hidden; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scanner-reader { position: relative; display: grid; min-height: 240px; overflow: hidden; place-items: center; border: 1px solid var(--line-strong); border-radius: 16px; background: #15211c; color: #d5ded9; }
.scanner-reader:empty::before { padding: 24px; content: "等待开始识别"; color: #aebbb5; font-size: 13px; text-align: center; }
.scanner-reader video, .scanner-reader img { width: 100% !important; max-height: 420px; border-radius: 15px; object-fit: contain; }
.scanner-reader canvas { max-width: 100%; }
.scanner-status, .scanner-error { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.scanner-status { background: var(--paper); color: var(--ink-soft); }
.scanner-error { border: 1px solid #e7c4c0; background: var(--danger-soft); color: var(--danger); }
.scanner-footer { display: flex; justify-content: flex-end; }

@media (max-width: 650px) {
  .hero-search-entry { width: 100%; border-radius: 10px; background: rgba(255,255,255,.06); }
  .mobile-scan-trigger { display: inline-flex; min-height: 42px; flex: 0 0 auto; align-items: center; gap: 5px; padding: 0 10px; border: 0; border-left: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; cursor: pointer; font-size: 13px; font-weight: 750; white-space: nowrap; }
  .mobile-scan-trigger svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
  .scanner-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 18px - env(safe-area-inset-bottom)); margin: auto auto max(8px, env(safe-area-inset-bottom)); border-radius: 21px 21px 16px 16px; }
  .scanner-sheet { max-height: calc(100dvh - 18px - env(safe-area-inset-bottom)); padding: 17px; }
  .scanner-reader { min-height: 220px; }
}

@media (max-width: 390px) {
  .scanner-actions { grid-template-columns: 1fr; }
}

html.is-mobile-ui .mobile-scan-trigger { display: inline-flex; min-height: 42px; flex: 0 0 auto; align-items: center; gap: 5px; padding: 0 10px; border: 0; border-left: 1px solid rgba(255,255,255,.18); background: transparent; color: #fff; cursor: pointer; font-size: 13px; font-weight: 750; white-space: nowrap; }
html.is-mobile-ui .barcode-scan-trigger { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; padding: 0 13px; border: 1px solid var(--green); border-left: 0; border-radius: 0 10px 10px 0; background: var(--green); color: #fff; cursor: pointer; font-size: 13px; font-weight: 800; white-space: nowrap; }
html.is-mobile-ui .scanner-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 18px - env(safe-area-inset-bottom)); margin: auto auto max(8px, env(safe-area-inset-bottom)); border-radius: 21px 21px 16px 16px; }
html.is-mobile-ui .scanner-sheet { max-height: calc(100dvh - 18px - env(safe-area-inset-bottom)); padding: 17px; }

/* Category-aware identification fields and mobile-assisted item capture. */
.field-inline-action { display: flex; min-width: 0; align-items: stretch; }
.field-inline-action > input { min-width: 0; flex: 1; border-radius: 10px; }
.barcode-scan-trigger { display: none; }
.category-fields { margin-top: 3px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.category-fields-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.category-fields-heading > strong { font-size: 14px; }
.category-fields-heading > span { text-align: right; }
.category-fields-grid:empty { display: none; }
.field-skeleton { height: 72px; grid-column: 1 / -1; overflow: hidden; border-radius: 10px; background: #e8e5dc; }
.field-skeleton::after { display: block; width: 100%; height: 100%; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.66) 42%, transparent 64%); content: ""; animation: skeleton-sweep 1.25s ease-in-out infinite; transform: translateX(-100%); }
.mobile-ai-recognition { display: none; }

@media (max-width: 650px) {
  .field-inline-action > input { border-radius: 10px 0 0 10px; }
  .barcode-scan-trigger { display: inline-flex; min-height: 44px; align-items: center; gap: 5px; padding: 0 13px; border: 1px solid var(--green); border-left: 0; border-radius: 0 10px 10px 0; background: var(--green); color: #fff; cursor: pointer; font-size: 13px; font-weight: 800; white-space: nowrap; }
  .category-fields { padding: 13px; }
  .category-fields-heading { align-items: flex-start; flex-direction: column; gap: 3px; margin-bottom: 11px; }
  .category-fields-heading > span { text-align: left; }
  .mobile-ai-recognition { display: grid; gap: 10px; margin: 12px 0 16px; padding: 13px; border: 1px solid #bdcfc6; border-radius: 14px; background: var(--green-soft); }
  .mobile-ai-recognition > p { margin: 0; color: var(--green-deep); font-size: 12px; line-height: 1.5; }
  .ai-recognition-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .ai-recognition-head > div { display: grid; gap: 2px; }
  .ai-recognition-head span { color: var(--ink-faint); font-size: 11px; }
  .ai-badge { display: grid; width: 35px; height: 27px; place-items: center; border-radius: 9px; background: var(--green); color: #fff !important; font-size: 11px !important; font-weight: 900; letter-spacing: .08em; }
  .ai-photo-review { display: grid; grid-template-columns: 86px minmax(0,1fr); align-items: center; gap: 10px; padding: 9px; border-radius: 11px; background: rgba(255,255,255,.7); }
  .ai-photo-review[hidden] { display: none; }
  .ai-photo-review img { width: 86px; height: 72px; border-radius: 8px; object-fit: cover; }
  .ai-photo-review > div { display: grid; justify-items: start; gap: 7px; }
  .ai-photo-review span { color: var(--ink-faint); font-size: 11px; }
  .ai-status { padding: 9px 10px; border-radius: 9px; background: rgba(255,255,255,.72); }
  .ai-status[data-kind="error"] { background: var(--danger-soft); color: var(--danger); }
  .ai-status[data-kind="success"] { background: #f5fbf7; color: var(--green-deep); }
  .ai-status[data-kind="busy"] { position: relative; overflow: hidden; }
  .ai-status[data-kind="busy"]::after { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.6) 45%, transparent 70%); content: ""; animation: skeleton-sweep 1.25s ease-in-out infinite; transform: translateX(-100%); }
  .ai-suggestions { display: grid; gap: 9px; padding-top: 10px; border-top: 1px solid rgba(63,89,76,.18); }
  .ai-suggestions[hidden] { display: none; }
  .ai-suggestions > p { color: var(--ink-faint); }
  .ai-suggestion-row { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: start; gap: 8px; padding: 8px 9px; border: 1px solid rgba(63,89,76,.16); border-radius: 10px; background: rgba(255,255,255,.76); }
  .ai-suggestion-row input { margin-top: 3px; }
  .ai-suggestion-row span { display: grid; gap: 2px; }
  .ai-suggestion-row strong { font-size: 12px; }
  .ai-suggestion-row small { overflow-wrap: anywhere; color: var(--ink-soft); }
}
