
:root {
  color-scheme: light;
  --ink: #202520;
  --muted: #687168;
  --line: #ddd5c5;
  --paper: #f4efe5;
  --paper-2: #ece4d6;
  --panel: #ffffff;
  --green: #174734;
  --green-2: #235f49;
  --green-soft: #e4eee7;
  --red: #9b3d33;
  --red-soft: #f2e4df;
  --gold: #b98635;
  --blue: #2f5d78;
  --shadow: 0 18px 46px rgba(34, 31, 24, .12);
  --soft-shadow: 0 8px 22px rgba(34, 31, 24, .08);
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif; background: linear-gradient(180deg, #efe6d7 0, var(--paper) 280px, #f8f6f0 100%); color: var(--ink); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .34; background-image: linear-gradient(rgba(95, 79, 55, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(95, 79, 55, .06) 1px, transparent 1px); background-size: 28px 28px; }
a { color: inherit; text-decoration: none; }
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(31, 52, 41, .94); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 10px 28px rgba(28, 37, 30, .16); }
.nav { max-width: 1280px; margin: 0 auto; padding: 13px 24px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.brand { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; padding-left: 14px; position: relative; color: #fff; }
.brand::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; background: var(--gold); border-radius: 2px; }
.brand strong { font-size: 20px; letter-spacing: 0; color: #fff; line-height: 1.1; }
.brand span { font-size: 12px; color: rgba(255,255,255,.76); }
.navlinks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-width: 0; }
.lang-switch { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.navlinks a, .lang-switch a, .btn { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); border-radius: 6px; padding: 8px 11px; font-size: 13px; color: rgba(255,255,255,.88); white-space: nowrap; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.navlinks a:hover, .lang-switch a:hover, .btn:hover { border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.16); transform: translateY(-1px); }
.navlinks a.active, .lang-switch a.active { background: #f9f3e7; color: var(--green); border-color: #f9f3e7; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.btn { display: inline-flex; align-items: center; color: var(--green); border-color: var(--line); background: #fffaf1; box-shadow: var(--soft-shadow); }
.container { position: relative; max-width: 1280px; margin: 0 auto; padding: 30px 24px 64px; }
.hero { display: block; margin-bottom: 18px; }
.hero-main { position: relative; overflow: hidden; padding: 36px 38px; border: 1px solid rgba(23, 71, 52, .16); border-radius: 8px; background: linear-gradient(135deg, #fffaf0 0, #f6ead8 54%, #e2eadf 100%); box-shadow: var(--shadow); }
.hero-main::after { content: ""; position: absolute; inset: 16px; border: 1px dashed rgba(155, 61, 51, .35); border-radius: 7px; pointer-events: none; }
.hero-main > * { position: relative; z-index: 1; }
h1 { margin: 0 0 10px; font-size: clamp(34px, 4.8vw, 58px); line-height: 1.02; letter-spacing: 0; color: var(--green); max-width: 860px; }
.lede { margin: 0; color: #536057; max-width: 760px; line-height: 1.72; font-size: 16px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 22px; }
.metric { position: relative; overflow: hidden; background: rgba(255, 255, 255, .86); border: 1px solid rgba(221, 213, 197, .9); border-radius: 8px; padding: 17px 18px; box-shadow: var(--soft-shadow); }
.metric::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gold); }
.metric:nth-child(2)::before { background: var(--red); }
.metric:nth-child(3)::before { background: var(--blue); }
.metric span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { font-size: 30px; color: var(--green); line-height: 1; }
.section { padding: 0; margin-bottom: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; padding: 0 2px; }
h2 { margin: 0; font-size: 22px; color: var(--green); }
.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 210px auto; gap: 10px; margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.78); box-shadow: var(--soft-shadow); }
input, select { width: 100%; border: 1px solid #d8cfbd; border-radius: 6px; background: #fffdf8; padding: 11px 12px; font-size: 14px; color: var(--ink); outline: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(35, 95, 73, .14); background: #fff; }
button { cursor: pointer; border: 0; background: linear-gradient(180deg, var(--green-2), var(--green)); color: #fff; border-radius: 6px; padding: 11px 18px; font-size: 14px; font-weight: 700; box-shadow: 0 8px 18px rgba(23, 71, 52, .2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.card { overflow: hidden; background: var(--panel); border: 1px solid rgba(221, 213, 197, .95); border-radius: 8px; box-shadow: var(--soft-shadow); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.card:hover { transform: translateY(-3px); border-color: rgba(23, 71, 52, .32); box-shadow: 0 20px 42px rgba(34, 31, 24, .14); }
.thumb { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #eee8dc, #f8f4ec); display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 10px; background: #fbfaf5; }
.thumb.empty { color: var(--muted); font-size: 13px; }
.card-body { padding: 15px; }
.card-title { font-weight: 800; color: var(--green); margin-bottom: 10px; line-height: 1.36; min-height: 2.7em; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.pill { border: 1px solid #ddd2bd; border-radius: 999px; padding: 4px 9px; font-size: 12px; color: #5e625c; background: #fffaf1; }
.pill.category { color: var(--green); background: var(--green-soft); border-color: #c5d8cc; font-weight: 700; }
.card-small { font-size: 13px; color: var(--muted); line-height: 1.5; border-top: 1px solid #eee6d8; padding-top: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.9); box-shadow: var(--soft-shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid #ebe2d2; padding: 12px 11px; text-align: left; vertical-align: top; }
tbody tr:hover { background: #fffaf1; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--green); background: #efe8d9; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.detail-grid { display: grid; grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.detail-media, .detail-panel { background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--soft-shadow); }
.detail-media { padding: 18px; }
.detail-panel { padding: 22px; }
.detail-media img { width: 100%; max-height: 560px; object-fit: contain; background: #fbfaf5; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.detail-panel h1 { font-size: clamp(28px, 3.8vw, 44px); }
.kv { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 10px 14px; font-size: 14px; margin-top: 16px; }
.kv span { color: var(--muted); }
.kv strong { color: #27302a; font-weight: 700; }
.description { line-height: 1.78; color: #323638; white-space: pre-wrap; background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; box-shadow: var(--soft-shadow); }
.auth-panel, .collection-panel, .upload-panel { background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 8px; padding: 18px; box-shadow: var(--soft-shadow); }
.auth-panel { max-width: 440px; margin: 24px auto; }
.auth-panel h1 { font-size: 32px; }
.auth-form, .upload-form { display: grid; gap: 12px; }
.auth-form label, .upload-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.collection-actions { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.collection-panel { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.collection-panel p, .upload-panel p { margin: 0; color: var(--muted); line-height: 1.5; }
.owned-cell { width: 74px; text-align: center; }
.owned-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; border: 1px solid var(--line); border-radius: 6px; background: #fffaf1; color: var(--green); font-weight: 800; }
.owned-toggle input { width: auto; margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 14px; }
.photo-card { background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 8px; padding: 10px; box-shadow: var(--soft-shadow); }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; background: #fbfaf5; border: 1px solid var(--line); border-radius: 6px; }
.photo-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.upload-panel { margin-top: 14px; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 22px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span, .pagination button { min-width: 40px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; background: rgba(255,255,255,.86); color: var(--green); box-shadow: var(--soft-shadow); text-align: center; font-size: 14px; line-height: 1.2; }
.pagination a:hover { border-color: rgba(23, 71, 52, .32); background: #fff; }
.pagination .disabled { color: #a39d91; background: rgba(255,255,255,.52); box-shadow: none; }
.page-status { font-weight: 700; }
.page-jump { display: inline-flex; gap: 6px; align-items: center; margin-left: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.72); box-shadow: var(--soft-shadow); flex-wrap: nowrap; }
.page-jump label { color: var(--muted); font-size: 13px; padding-left: 5px; white-space: nowrap; }
.page-jump input { width: 58px; padding: 7px 6px; text-align: center; }
.page-jump button { min-width: auto; padding: 8px 10px; background: linear-gradient(180deg, var(--green-2), var(--green)); color: #fff; box-shadow: none; white-space: nowrap; }
.alert { border-left: 4px solid var(--gold); padding: 13px 15px; background: #fff6df; color: #59421c; border-radius: 6px; box-shadow: var(--soft-shadow); }
@media (max-width: 820px) {
  .nav { display: flex; align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .navlinks { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .navlinks a, .lang-switch a { flex: 0 0 auto; scroll-snap-align: start; }
  .lang-switch { justify-content: flex-start; }
  .container { padding: 18px 16px 44px; }
  .detail-grid { grid-template-columns: 1fr; }
  .hero-main, .detail-media, .detail-panel, .filters, .card { border-radius: 7px; }
  .hero-main { padding: 24px; }
  h1 { font-size: 30px; line-height: 1.12; }
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding: 14px; }
  .filters { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
  .collection-actions { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .brand strong { font-size: 17px; }
  .brand span { font-size: 11px; }
  .navlinks { gap: 8px; margin: 0 -16px; padding: 0 16px 6px; }
  .navlinks a, .lang-switch a, .btn { padding: 8px 10px; font-size: 12px; }
  .container { padding: 16px 12px 36px; }
  .metrics { grid-template-columns: 1fr; gap: 10px; }
  .grid { grid-template-columns: 1fr; }
  .hero-main { padding: 20px; }
  .hero-main::after { inset: 10px; }
  .page-jump { justify-content: center; margin-left: 0; }
  .kv { grid-template-columns: 1fr; gap: 3px 0; }
  th, td { padding: 8px 6px; }
}
