:root {
  --bg: #1a2026;
  --header-bg: rgba(26, 32, 38, 0.92);
  --card: #232e3c;
  --card-hover: #2a3746;
  --line: #2e3a47;
  --text: #ffffff;
  --muted: #8794a1;
  --accent: #248bda;
  --accent-hover: #3d9be4;
  --link: #4db2ff;
  --green: #5ac46b;
  --red: #e86565;
  --orange: #e8a03f;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.muted, .sub { color: var(--muted); }
.sub { font-size: 13px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.logo { color: var(--text); font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 22px; flex: 1; }
.nav-item { color: var(--muted); font-weight: 500; padding: 19px 0; border-bottom: 2px solid transparent; }
.nav-item:hover { color: var(--text); text-decoration: none; }
.nav-item.active { color: var(--text); border-bottom-color: var(--accent); }
.header-actions { display: flex; gap: 10px; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 20px; height: 2px; margin: 4px 0; background: var(--text); border-radius: 1px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 18px; border-radius: 10px; border: 0;
  font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
  color: var(--text); background: var(--card);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--link); }
.btn-outline:hover { background: rgba(36, 139, 218, 0.12); }
.btn-secondary { background: var(--card); }
.btn-secondary:hover { background: var(--card-hover); }
.btn-link { background: none; color: var(--link); padding: 0; height: auto; font-weight: 500; }
.btn-wide { width: 100%; height: 46px; margin-top: 16px; font-size: 15px; }

/* Layout */
.main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 20px 48px; }
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: 34px; letter-spacing: -0.5px; }
.hero p { max-width: 560px; margin: 12px auto 0; color: var(--muted); font-size: 16px; }
.hero b { color: var(--text); }

.search { margin: 26px auto 30px; max-width: 760px; }
.search-input {
  width: 100%; height: 50px; padding: 0 18px 0 46px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card) no-repeat 16px 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238794a1' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E");
  color: var(--text); font: 16px var(--font); outline: none;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.list-head h2 { font-size: 22px; }
.list-tools { display: flex; align-items: center; gap: 6px; }
.view-toggle { color: var(--muted); padding: 4px 8px; border-radius: 8px; font-size: 16px; }
.view-toggle.active, .view-toggle:hover { color: var(--text); background: var(--card); text-decoration: none; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.tab { color: var(--muted); padding: 7px 14px; border-radius: 18px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); background: var(--card); }

.dropdown { position: relative; }
.dropdown summary {
  list-style: none; cursor: pointer; padding: 7px 12px; border-radius: 10px;
  background: var(--card); font-weight: 500; display: flex; gap: 6px; align-items: center;
}
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: ""; border: 4px solid transparent; border-top-color: var(--muted); margin-top: 4px; }
.dropdown-label { color: var(--muted); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.dropdown-item { display: block; color: var(--text); padding: 9px 12px; border-radius: 8px; }
.dropdown-item:hover { background: var(--card-hover); text-decoration: none; }
.dropdown-item.active { color: var(--link); }

/* Tables */
.table { border-radius: var(--radius); overflow: hidden; background: var(--card); }
.table-head, .table-row {
  display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 12px; align-items: center; padding: 12px 18px;
}
.table-head { color: var(--muted); font-size: 13px; font-weight: 500; border-bottom: 1px solid var(--line); }
.table-row { color: var(--text); border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: 0; }
a.table-row:hover { background: var(--card-hover); text-decoration: none; }
.table-empty { color: var(--muted); text-align: center; padding: 32px 18px; }
.name { font-weight: 600; }
.value { font-weight: 600; }

.price { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.gem {
  display: inline-block; width: 15px; height: 13px; flex: none;
  background: url("/static/gram.svg") no-repeat center / contain;
}

.status { display: inline-block; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 12px; background: rgba(135, 148, 161, 0.15); color: var(--muted); }
.status-available { color: var(--green); background: rgba(90, 196, 107, 0.14); }
.status-auction { color: var(--link); background: rgba(77, 178, 255, 0.14); }
.status-sale { color: var(--orange); background: rgba(232, 160, 63, 0.14); }
.status-sold, .status-taken { color: var(--muted); }
.badge { font-size: 12px; color: var(--muted); background: rgba(135, 148, 161, 0.15); padding: 1px 7px; border-radius: 8px; margin-left: 4px; }

/* Items */
.item { max-width: 760px; margin: 0 auto; }
.item-gift { max-width: 980px; }
.back { display: inline-block; color: var(--muted); margin-bottom: 14px; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.item-title { font-size: 30px; letter-spacing: -0.3px; word-break: break-all; }
.subscribe { margin: 10px 0 18px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { margin: 0 0 8px; }
.card p:last-child { margin-bottom: 0; }
.how { margin-top: 24px; }
.how ol { margin: 6px 0 10px; padding-left: 20px; color: var(--muted); }
.how li { margin: 4px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat-label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.stat-value { font-size: 20px; font-weight: 600; }
.stat-value .price { font-size: 20px; }
.stat-value .gem { width: 19px; height: 16px; }
.stat-value .muted { font-size: 14px; font-weight: 500; }
.details { background: var(--card); border-radius: var(--radius); margin-bottom: 16px; }
.details-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.details-row:last-child { border-bottom: 0; }
.details-label { color: var(--muted); }
.section-title { font-size: 18px; margin: 26px 0 12px; }

/* Gifts */
.with-side { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
.side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
.side-title { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.side-item:hover { background: var(--card); text-decoration: none; }
.side-item.active { background: var(--card); }
.side-item > span:first-child:not(.side-thumb) { flex: 1; }
.side-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-thumb { width: 28px; height: 28px; flex: none; }
.filters { margin-top: 14px; }
.filter { border-top: 1px solid var(--line); padding: 10px 0; }
.filter summary { cursor: pointer; font-weight: 600; list-style: none; }
.filter summary::-webkit-details-marker { display: none; }
.filter-items { margin-top: 8px; max-height: 260px; overflow-y: auto; }
.filter-item { display: flex; align-items: center; gap: 8px; padding: 5px 2px; cursor: pointer; }
.filter-item span:nth-child(2) { flex: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gift-card { background: var(--card); border-radius: var(--radius); overflow: hidden; color: var(--text); display: flex; flex-direction: column; }
.gift-card:hover { background: var(--card-hover); text-decoration: none; }
.gift-card .gift-art { border-radius: 0; }
.gift-card-body { padding: 10px 12px 12px; }
.gift-card-num { color: var(--muted); font-size: 13px; }
.gift-card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }
.gift-cell { display: flex; align-items: center; gap: 12px; }
.gift-cell .gift-art { width: 44px; height: 44px; border-radius: 10px; flex: none; }

.gift-art {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(circle at 50% 45%, var(--center, #3b4a5c) 0%, var(--edge, #232e3c) 75%);
}
.gift-art .pattern { position: absolute; inset: 0; pointer-events: none; }
.gift-art .pattern img { position: absolute; transform: translate(-50%, -50%); }
.gift-art .model { position: absolute; left: 18%; top: 14%; width: 64%; height: 64%; }
.gift-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.gift-picture .gift-art { border-radius: 18px; }
.show-more { margin-top: 18px; }

/* Texts */
.text { max-width: 760px; margin: 0 auto; }
.text h1 { font-size: 30px; margin-bottom: 14px; }
.text h2 { font-size: 21px; margin: 30px 0 10px; }
.text h3 { font-size: 17px; margin: 22px 0 8px; }
.text p, .text li { color: #c7d0d9; }
.text .index { background: var(--card); border-radius: var(--radius); padding: 14px 20px; }
.text .index a { display: block; padding: 4px 0; }

/* Login */
.login-code { font-size: 56px; line-height: 1.2; margin: 6px 0 4px; }
.login-qr { margin: 8px auto 4px; width: 200px; }
.login-qr svg { display: block; width: 200px; height: 200px; border-radius: 12px; }
.login-status { margin-top: 12px; }
.viewer summary { color: var(--text); }
.viewer .dropdown-menu { min-width: 180px; }
.wallet summary { gap: 6px; }
.address-full { font-size: 12px; word-break: break-all; }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 22px 20px; display: flex; flex-wrap: wrap; gap: 22px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* The window */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { width: 100%; max-width: 400px; background: var(--card); border-radius: 16px; padding: 24px; text-align: center; }
.modal-box h3 { font-size: 20px; margin-bottom: 10px; }
.modal-box p { margin: 0 0 8px; }
.modal-buttons { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.modal-buttons .btn { min-width: 120px; }

@media (max-width: 860px) {
  .with-side { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .gift-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .header-inner { gap: 12px; }
  .burger { display: block; }
  .header-actions { margin-left: auto; }
  .list-head h2 { font-size: 19px; white-space: nowrap; }
  .dropdown-label { display: none; }
  .dropdown summary { white-space: nowrap; }
  .nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 6px 20px 12px;
  }
  .nav.open { display: flex; }
  .nav-item { padding: 12px 0; border: 0; }
  .header-actions .btn-outline { display: none; }
  .header-actions .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .hero h1 { font-size: 27px; }
  .table-head, .table-row { grid-template-columns: 1.4fr 1fr; }
  .hide-mobile { display: none; }
  .item-title { font-size: 24px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
