:root {
  color-scheme: dark;
  --bg: #0d131c;
  --panel: #151f2d;
  --panel-2: #1a2636;
  --panel-3: #202e40;
  --line: #334258;
  --line-soft: #27364a;
  --text: #f4f7fa;
  --muted: #b7c1ce;
  --faint: #8290a2;
  --gold: #e2b965;
  --gold-dark: #6e5628;
  --teal: #65c7bc;
  --danger: #f28b82;
  --radius: 14px;
  --shadow: 0 18px 45px rgba(0, 0, 0, .28);
  font-family: "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--text); background: radial-gradient(circle at 80% -15%, rgba(62, 109, 122, .22), transparent 38rem), var(--bg); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: 78px; padding: 0 max(24px, calc((100vw - 1520px) / 2));
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(107, 127, 151, .28); background: rgba(13, 19, 28, .92); backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 13px; color: var(--text); text-decoration: none; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid var(--gold-dark); border-radius: 12px; color: var(--gold); background: linear-gradient(145deg, #233044, #111925); font-weight: 800; letter-spacing: .04em; }
.brand > span:last-child { display: grid; line-height: 1.1; }
.brand strong { font-size: 1.05rem; letter-spacing: .02em; }
.brand small { margin-top: 5px; color: var(--faint); font-size: .68rem; letter-spacing: .14em; }
.view-switch { position: absolute; left: 50%; display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(17, 26, 38, .86); transform: translateX(-50%); }
.view-switch button { display: flex; gap: 7px; align-items: center; border: 0; border-radius: 8px; padding: 8px 15px; color: var(--faint); background: transparent; cursor: pointer; }
.view-switch button:hover { color: var(--text); }
.view-switch button.active { color: #17130a; background: var(--gold); box-shadow: 0 5px 16px rgba(226, 185, 101, .18); }
.view-switch button span { font-size: .78rem; }
.view-switch button b { font-size: .78rem; }
.top-actions, .locale-switch { display: flex; align-items: center; gap: 12px; }
.calculator-link { color: var(--muted); text-decoration: none; padding: 10px 15px; border-radius: 9px; }
.calculator-link:hover { color: var(--text); background: var(--panel-2); }
.locale-switch { gap: 4px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 11px; background: #111a26; }
.locale-switch button { border: 0; border-radius: 7px; padding: 7px 11px; color: var(--muted); background: transparent; cursor: pointer; font-size: .82rem; }
.locale-switch button.active { color: #17130a; background: var(--gold); font-weight: 750; }

.page-shell { width: min(1520px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0; }
.site-footer { padding: 0 24px 24px; text-align: center; font-size: .72rem; }
.site-footer a { color: var(--faint); text-decoration: none; }
.site-footer a:hover { color: var(--muted); text-decoration: underline; }
.eyebrow, #resultKicker { margin: 0 0 10px; color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .2em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
input, textarea { min-width: 0; border: 1px solid var(--line); outline: 0; border-radius: 10px; color: var(--text); background: #0e1722; transition: border .2s, box-shadow .2s; }
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226, 185, 101, .13); }

.chat-view { width: min(1180px, 100%); height: calc(100dvh - 134px); min-height: 560px; margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 22px; background: radial-gradient(circle at 88% 8%, rgba(101, 199, 188, .08), transparent 24rem), linear-gradient(145deg, rgba(24, 36, 52, .98), rgba(12, 20, 30, .99)); box-shadow: 0 28px 70px rgba(0, 0, 0, .34); }
.chat-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); background: rgba(17, 27, 40, .72); }
.assistant-identity { min-width: 0; display: flex; align-items: center; gap: 12px; }
.assistant-mark, .message-avatar { display: grid; place-items: center; flex: 0 0 auto; color: #17130a; background: linear-gradient(145deg, #f0cc7e, #c89842); box-shadow: 0 8px 20px rgba(226, 185, 101, .16); }
.assistant-mark { width: 40px; height: 40px; border-radius: 12px; }
.assistant-identity > span:last-child { min-width: 0; display: grid; line-height: 1.25; }
.assistant-identity strong { font-size: .9rem; }
.assistant-identity small { margin-top: 3px; overflow: hidden; color: var(--faint); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.new-chat-button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; color: var(--muted); background: #111b28; cursor: pointer; font-size: .73rem; }
.new-chat-button:hover { color: var(--text); border-color: #52647d; }

.chat-thread { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 34px clamp(24px, 6vw, 78px) 24px; scrollbar-color: #3d4d63 transparent; }
.chat-empty { min-height: 100%; display: grid; place-items: center; align-content: center; padding: 28px 0 54px; text-align: center; animation: message-in .45s ease-out; }
.empty-orbit { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin-bottom: 25px; border: 1px solid rgba(226, 185, 101, .24); border-radius: 50%; box-shadow: 0 0 0 15px rgba(226, 185, 101, .025), 0 0 0 30px rgba(101, 199, 188, .018); }
.empty-orbit::before { content: ""; position: absolute; inset: -8px; border: 1px solid transparent; border-top-color: rgba(101, 199, 188, .55); border-radius: 50%; animation: orbit 6s linear infinite; }
.empty-orbit i { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; color: var(--gold); background: linear-gradient(145deg, #243247, #101925); font-family: Georgia, serif; font-style: normal; font-weight: 800; }
.chat-empty h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.1; letter-spacing: -.035em; }
.chat-empty > p:not(.eyebrow) { max-width: 670px; margin: 17px auto 0; color: var(--muted); font-size: .91rem; line-height: 1.75; }
.prompt-suggestions { width: min(820px, 100%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 34px; }
.prompt-suggestions button { min-height: 68px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 15px; color: var(--muted); background: rgba(22, 34, 49, .78); cursor: pointer; text-align: left; font-size: .76rem; line-height: 1.45; transition: border-color .18s, transform .18s, color .18s; }
.prompt-suggestions button::before { content: "↗"; display: block; margin-bottom: 5px; color: var(--gold); }
.prompt-suggestions button:hover { transform: translateY(-2px); border-color: #53657f; color: var(--text); }

.chat-message { width: min(920px, 100%); display: grid; gap: 12px; margin: 0 auto 30px; animation: message-in .28s ease-out; }
.chat-message.user-message { justify-items: end; }
.message-meta { color: var(--faint); font-size: .66rem; font-weight: 700; letter-spacing: .04em; }
.user-message .message-body { max-width: min(720px, 86%); padding: 14px 18px; border: 1px solid #4d6079; border-radius: 16px 16px 4px 16px; color: var(--text); background: linear-gradient(145deg, #26364b, #1d2a3c); box-shadow: 0 12px 28px rgba(0, 0, 0, .16); }
.user-message p { margin: 0; white-space: pre-wrap; line-height: 1.65; }
.assistant-message { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
.message-avatar { width: 42px; height: 42px; border-radius: 13px; font-size: .72rem; font-weight: 900; }
.assistant-message .message-column { min-width: 0; }
.assistant-message .message-meta { margin: 1px 0 8px; }
.assistant-response { padding: 20px 22px; border: 1px solid var(--line-soft); border-radius: 4px 16px 16px 16px; background: rgba(16, 26, 39, .82); }
.agent-process { margin: 0 0 17px; border: 1px solid rgba(101, 199, 188, .22); border-radius: 10px; background: rgba(10, 18, 27, .5); }
.agent-process summary { display: flex; align-items: center; gap: 9px; padding: 10px 12px; color: var(--muted); cursor: pointer; font-size: .7rem; list-style: none; }
.agent-process summary::-webkit-details-marker { display: none; }
.process-orb { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(101, 199, 188, .09); animation: agent-pulse 1.4s ease-in-out infinite; }
.agent-process summary i { margin-left: auto; color: var(--faint); font-style: normal; transition: transform .2s; }
.agent-process[open] summary i { transform: rotate(180deg); }
.agent-trace { display: grid; gap: 7px; margin: 0; padding: 0 13px 12px 29px; color: var(--faint); font-size: .67rem; list-style: none; }
.agent-trace li { position: relative; }
.agent-trace li::before { content: ""; position: absolute; left: -15px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.chat-answer { min-height: 1.6em; color: var(--text); line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-message.is-streaming .chat-answer:not(:empty)::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -.15em; background: var(--gold); animation: agent-caret .8s steps(1) infinite; }
.agent-entities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 18px; }
.agent-entities button { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr) 18px; gap: 11px; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 10px; color: var(--text); background: #152131; cursor: pointer; text-align: left; }
.agent-entities button:hover { border-color: var(--teal); background: var(--panel-2); }
.agent-entities img, .agent-entity-fallback { width: 48px; height: 48px; display: grid; place-items: center; object-fit: contain; border-radius: 8px; color: var(--gold); background: #0d1621; font-family: Georgia, serif; }
.agent-entities span { min-width: 0; display: grid; }
.agent-entities small { color: var(--teal); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; }
.agent-entities strong, .agent-entities em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-entities strong { font-size: .77rem; }
.agent-entities em { margin-top: 2px; color: var(--faint); font-size: .62rem; font-style: normal; }
.agent-entities i { color: var(--gold); font-style: normal; }

.chat-composer { padding: 14px clamp(22px, 6vw, 76px) 17px; border-top: 1px solid var(--line-soft); background: rgba(12, 20, 30, .92); backdrop-filter: blur(16px); }
.composer-box { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 10px; align-items: end; padding: 9px 9px 9px 16px; border: 1px solid #40516a; border-radius: 15px; background: #0e1722; box-shadow: 0 14px 32px rgba(0, 0, 0, .2); }
.composer-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(226, 185, 101, .1), 0 14px 32px rgba(0, 0, 0, .2); }
.composer-box textarea { width: 100%; max-height: 140px; min-height: 34px; resize: none; overflow-y: hidden; border: 0; padding: 5px 0; background: transparent; box-shadow: none; line-height: 1.5; }
.composer-box textarea:focus { box-shadow: none; }
.composer-box button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #f0ca7c; border-radius: 11px; color: #17130a; background: var(--gold); cursor: pointer; font-size: 1.15rem; font-weight: 900; }
.composer-box button:disabled { opacity: .45; cursor: wait; }
.chat-composer > p { margin: 7px 2px 0; color: var(--faint); font-size: .6rem; text-align: center; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes agent-pulse { 50% { opacity: .5; transform: scale(.8); } }
@keyframes agent-caret { 50% { opacity: 0; } }

.browse-layout { display: grid; grid-template-columns: 255px minmax(0, 1fr); gap: 32px; align-items: start; }
.keyword-field span { display: block; margin-bottom: 9px; color: var(--muted); font-size: .78rem; font-weight: 700; }
#searchButton { flex: 0 0 auto; border: 1px solid #f0ca7c; border-radius: 10px; padding: 0 19px; color: #1a150c; background: var(--gold); font-weight: 800; cursor: pointer; }
.sidebar { position: sticky; top: 105px; max-height: calc(100vh - 125px); overflow-y: auto; padding: 20px 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(21, 31, 45, .88); }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 14px; border-bottom: 1px solid var(--line-soft); }
.sidebar-title h2 { margin: 0; font-size: .92rem; }
.sidebar-title button { border: 0; border-radius: 7px; padding: 5px 9px; color: var(--faint); background: transparent; cursor: pointer; font-size: .72rem; }
.sidebar-title button.active { color: var(--gold); background: rgba(226, 185, 101, .1); }
.category-list { display: grid; gap: 3px; padding-top: 10px; }
.category-option { width: 100%; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 9px; align-items: center; border-radius: 8px; padding: 9px 10px; color: var(--muted); background: transparent; cursor: pointer; }
.category-option:hover { color: var(--text); background: var(--panel-2); }
.category-option.active { color: var(--gold); background: rgba(226, 185, 101, .1); }
.category-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--gold); }
.category-option strong { color: var(--faint); font-size: .72rem; font-variant-numeric: tabular-nums; }
.equipment-subtypes { margin: 5px 5px 12px 31px; padding: 12px; border-left: 2px solid #465a74; border-radius: 0 9px 9px 0; background: rgba(9, 16, 25, .48); }
.equipment-subtypes-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); font-size: .76rem; font-weight: 800; }
.equipment-subtypes-heading button { border: 0; border-radius: 6px; padding: 4px 7px; color: var(--faint); background: transparent; cursor: pointer; font-size: .68rem; }
.equipment-subtypes-heading button.active { color: var(--gold); background: rgba(226, 185, 101, .11); }
.equipment-subtypes section { margin-top: 13px; }
.equipment-subtypes h3 { margin: 0 0 7px; color: var(--faint); font-size: .68rem; letter-spacing: .08em; }
.equipment-subtypes section > div { display: flex; flex-wrap: wrap; gap: 5px; }
.equipment-type-option { display: inline-flex; gap: 5px; align-items: center; border: 1px solid #33445b; border-radius: 7px; padding: 6px 8px; color: var(--muted); background: #121d2a; cursor: pointer; font-size: .72rem; }
.equipment-type-option:hover { color: var(--text); border-color: #596d88; }
.equipment-type-option.active { color: #17120a; border-color: var(--gold); background: var(--gold); }
.equipment-type-option strong { color: inherit; opacity: .65; font-size: .62rem; }

.catalog-toolbar { display: flex; align-items: end; gap: 10px; padding: 18px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); }
.keyword-field { flex: 1; }
.keyword-field input { width: 100%; height: 49px; padding: 0 15px; }
#searchButton { height: 49px; min-width: 96px; }
.result-heading { display: flex; align-items: end; justify-content: space-between; margin: 28px 2px 15px; }
.result-heading p { margin-bottom: 5px; }
.result-heading h2 { margin: 0; font-size: 1.45rem; }
#resultCount { color: var(--faint); font-size: .82rem; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.result-card { min-height: 164px; display: grid; grid-template-columns: 70px minmax(0, 1fr) 22px; gap: 14px; align-items: center; border: 1px solid var(--line-soft); border-radius: 13px; padding: 17px; color: var(--text); background: linear-gradient(145deg, var(--panel), #131d2a); text-align: left; cursor: pointer; transition: transform .18s, border-color .18s, background .18s; }
.result-card:hover { transform: translateY(-2px); border-color: #5b6d86; background: var(--panel-2); }
.card-icon { width: 70px; height: 70px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #0e1722; overflow: hidden; }
.card-icon img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.card-icon > span { color: var(--gold); font-family: Georgia, serif; font-size: 1.6rem; }
.card-content { min-width: 0; display: block; }
.card-content small { display: block; color: var(--teal); font-size: .66rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.card-content strong { display: block; margin-top: 4px; overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.card-content em { display: block; overflow: hidden; color: var(--faint); font-size: .72rem; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.card-content p { display: -webkit-box; margin: 10px 0 0; overflow: hidden; color: var(--muted); font-size: .75rem; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-arrow { color: var(--faint); font-size: 1.1rem; }
.empty-state { grid-column: 1 / -1; padding: 80px 24px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 24px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.pagination button { min-width: 42px; height: 42px; border: 1px solid #34465e; border-radius: 8px; padding: 0 12px; color: var(--muted); background: #111b28; cursor: pointer; font-weight: 700; }
.pagination button:hover:not(:disabled) { color: var(--text); border-color: #667b98; }
.pagination button.active { color: #17120a; border-color: var(--gold); background: var(--gold); }
.pagination button:disabled { opacity: .35; cursor: default; }
.pagination-pages { display: flex; align-items: center; gap: 5px; }
.pagination-gap { width: 22px; color: var(--faint); text-align: center; }
.pagination-summary { display: none; color: var(--muted); font-size: .78rem; white-space: nowrap; }

.detail-view { max-width: 1260px; margin: 0 auto; }
.back-button { margin-bottom: 20px; border: 0; padding: 9px 0; color: var(--muted); background: transparent; cursor: pointer; }
.back-button:hover { color: var(--gold); }
.detail-hero { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 30px; align-items: center; padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, #1d2a3b, #121c29); box-shadow: var(--shadow); }
.detail-icon { width: 150px; height: 150px; display: grid; place-items: center; border: 1px solid #40516a; border-radius: 18px; background: rgba(9, 15, 23, .64); overflow: hidden; }
.detail-icon img { width: 100%; height: 100%; object-fit: contain; }
.detail-icon span { color: var(--gold); font: 3rem Georgia, serif; }
.detail-category { margin: 0 0 7px; color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.detail-hero h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.08; letter-spacing: -.04em; }
.translation-line { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0 0; color: var(--gold); font-size: .88rem; }
.detail-description { max-width: 920px; margin: 18px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.75; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.detail-section { min-width: 0; padding: 25px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--panel); }
.detail-section.full { grid-column: 1 / -1; }
.detail-section h2 { margin: 0 0 17px; padding-bottom: 11px; border-bottom: 1px solid var(--line-soft); font-size: 1.05rem; }
.attribute-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; }
.attribute-grid div { min-width: 0; padding: 13px; border: 1px solid var(--line-soft); border-radius: 9px; background: #111b28; }
.attribute-grid dt { color: var(--faint); font-size: .68rem; }
.attribute-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--text); font-weight: 700; }
.stat-lines { display: grid; gap: 8px; }
.stat-lines > div { display: flex; align-items: baseline; gap: 6px; min-height: 46px; padding: 10px 12px; border-left: 3px solid var(--gold-dark); background: #111b28; }
.stat-lines b { color: var(--text); }
.stat-lines span { color: var(--gold); }
.effect-groups { display: grid; gap: 9px; }
.effect-group { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 11px; border: 1px solid var(--line-soft); border-radius: 9px; background: #111b28; }
.group-key { color: var(--gold); font-weight: 800; }
.effect-group > div { display: flex; flex-wrap: wrap; gap: 7px; }
.effect-pill { padding: 6px 9px; border: 1px solid #33455d; border-radius: 7px; color: var(--gold); background: #172334; font-size: .78rem; }
.effect-pill b { margin-right: 4px; color: var(--text); }
.mechanic-list { display: grid; gap: 7px; }
.mechanic-list div { padding: 11px 13px; border-radius: 8px; background: #111b28; }
.mechanic-list b { display: block; color: var(--teal); }
.mechanic-list span { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.linked-list { display: flex; flex-wrap: wrap; gap: 8px; }
.linked-list button, .generic-row button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); background: #111b28; cursor: pointer; }
.linked-list img { width: 30px; height: 30px; margin-right: 8px; object-fit: contain; vertical-align: middle; }
.linked-list small { margin-left: 7px; color: var(--faint); }
.generic-table { display: grid; gap: 7px; }
.generic-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; }
.generic-row span { display: grid; gap: 4px; }
.generic-row small { color: var(--faint); font-size: .68rem; }

.data-table { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.table-head, .table-row { display: grid; grid-template-columns: 1.15fr 1.55fr .72fr .52fr; gap: 14px; align-items: center; padding: 12px 15px; }
.table-head { color: var(--faint); background: #0f1824; font-size: .7rem; font-weight: 800; }
.table-row { min-height: 92px; border-top: 1px solid var(--line-soft); background: #162131; }
.table-row:nth-child(odd) { background: #131e2c; }
.entity-cell { display: flex; gap: 10px; align-items: center; border: 0; padding: 0; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.entity-cell img { width: 50px; height: 50px; flex: 0 0 auto; object-fit: contain; border-radius: 8px; background: #0d1621; }
.entity-cell span { min-width: 0; }
.entity-cell b, .entity-cell small { display: block; }
.entity-cell small { color: var(--faint); }
.map-cell { display: grid; gap: 7px; }
.name-stack { display: grid; gap: 2px; padding: 7px 9px; border-left: 2px solid #536780; background: #101a27; }
.name-stack > span { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.name-stack i { color: var(--gold); font-size: .62rem; font-style: normal; font-weight: 800; }
.chance { color: var(--gold); font-size: 1.05rem; }
.craft-table { display: grid; }
.craft-row { display: grid; grid-template-columns: 1fr 1.35fr; gap: 18px; padding: 16px; border-top: 1px solid var(--line-soft); background: #151f2e; }
.craft-row:first-child { border-top: 0; }
.craft-row > div { display: grid; gap: 8px; align-content: start; }
.craft-row small { color: var(--faint); }
.craft-row button { width: fit-content; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--text); background: #0f1925; cursor: pointer; }
.craft-row button img { width: 32px; height: 32px; object-fit: contain; }
.craft-row button b { color: var(--gold); }

@media (max-width: 1180px) {
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attribute-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root { font-size: 16px; }
  .topbar { position: relative; height: auto; min-height: 116px; flex-wrap: wrap; gap: 7px 12px; padding: 9px 16px; }
  .brand { order: 1; }
  .top-actions { order: 2; }
  .view-switch { position: static; order: 3; width: 100%; transform: none; }
  .view-switch button { flex: 1; justify-content: center; padding: 7px 12px; }
  .calculator-link { display: none; }
  .page-shell { width: min(100% - 24px, 1520px); padding-top: 20px; }
  .chat-view { height: calc(100dvh - 164px); min-height: 520px; border-radius: 16px; }
  .chat-header { min-height: 66px; padding: 12px 15px; }
  .chat-thread { padding: 25px 17px 18px; }
  .chat-empty { padding-bottom: 34px; }
  .prompt-suggestions { grid-template-columns: 1fr; max-width: 520px; margin-top: 25px; }
  .prompt-suggestions button { min-height: 52px; }
  .assistant-message { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; }
  .message-avatar { width: 36px; height: 36px; border-radius: 11px; }
  .assistant-response { padding: 16px; }
  .chat-composer { padding: 11px 12px 13px; }
  .agent-entities { grid-template-columns: 1fr; }
  .browse-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-subtypes { grid-column: 1 / -1; }
  .detail-hero { grid-template-columns: 92px minmax(0, 1fr); padding: 22px; }
  .detail-icon { width: 92px; height: 92px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-section.full { grid-column: auto; }
  .attribute-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-head { display: none; }
  .table-row { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
  .craft-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand small { display: none; }
  .locale-switch button { padding: 6px 8px; }
  .assistant-identity small { max-width: 185px; }
  .new-chat-button > span:last-child { display: none; }
  .chat-thread { padding-inline: 12px; }
  .chat-empty h1 { font-size: 2rem; }
  .empty-orbit { width: 76px; height: 76px; }
  .user-message .message-body { max-width: 92%; }
  .assistant-response { padding: 14px 13px; }
  .agent-entities button { grid-template-columns: 42px minmax(0, 1fr) 16px; }
  .agent-entities img, .agent-entity-fallback { width: 42px; height: 42px; }
  .chat-composer > p { display: none; }
  .result-grid { grid-template-columns: 1fr; }
  .catalog-toolbar { align-items: stretch; }
  #searchButton { min-width: 74px; }
  .category-list { grid-template-columns: 1fr; }
  .equipment-subtypes { margin-left: 24px; }
  .pagination { justify-content: space-between; gap: 7px; padding: 10px; }
  .pagination-pages { display: none; }
  .pagination-summary { display: inline; }
  .pagination button { min-width: 0; padding: 0 10px; }
  .detail-hero { grid-template-columns: 1fr; }
  .attribute-grid { grid-template-columns: 1fr; }
  .effect-group { grid-template-columns: 1fr; }
}
