:root {
  --paper: #f4f1ea;
  --paper-deep: #ece7dc;
  --surface: #fffefa;
  --surface-2: #faf8f2;
  --ink: #18212b;
  --muted: #75808b;
  --line: #dedbd3;
  --line-soft: #ebe8e0;
  --violet: #4f46e5;
  --violet-soft: #eeedff;
  --coral: #e9674d;
  --coral-soft: #fff0ec;
  --sage: #397a60;
  --sage-soft: #eaf4ef;
  --amber: #a76b19;
  --amber-soft: #fff3dc;
  --red-up: #dc3c32;
  --green-down: #178763;
  --shadow-sm: 0 1px 2px rgb(24 33 43 / 5%), 0 8px 24px rgb(24 33 43 / 4%);
  --shadow-lg: 0 30px 80px rgb(24 33 43 / 15%), 0 8px 24px rgb(24 33 43 / 8%);
  --radius: 18px;
  --sidebar: 238px;
  font-family: 'Avenir Next', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100dvh; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
input, textarea, select { color: var(--ink); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow { margin: 0 0 5px; color: var(--violet); font-size: 10px; font-weight: 700; letter-spacing: .18em; }
.wordmark { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.wordmark-dot { width: 10px; height: 10px; display: inline-block; border-radius: 50%; background: var(--violet); box-shadow: 7px -5px 0 -3px var(--coral); }

.access-gate { min-height: 100dvh; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(480px, 640px); background: var(--paper); overflow: hidden; }
.gate-atmosphere { position: relative; overflow: hidden; background: #1d2933; isolation: isolate; }
.gate-atmosphere::before { content: ''; position: absolute; inset: -20%; background: radial-gradient(circle at 30% 25%, #7a726744 0 10%, transparent 35%), radial-gradient(circle at 70% 65%, #4f46e555, transparent 28%), linear-gradient(135deg, #151f27, #24343e); filter: saturate(.8); }
.gate-atmosphere::after { content: ''; position: absolute; inset: 0; opacity: .12; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); mix-blend-mode: overlay; z-index: 3; }
.gate-mark { position: absolute; left: 11%; bottom: 9%; color: #ffffff0a; font-size: clamp(140px, 22vw, 360px); font-weight: 700; line-height: .8; letter-spacing: -.1em; }
.orbit { position: absolute; border: 1px solid #ffffff27; border-radius: 50%; z-index: 2; }
.orbit::after { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px #e9674d22; }
.orbit-one { width: 62vw; height: 62vw; left: -27vw; top: -17vw; animation: orbit-drift 16s ease-in-out infinite alternate; }
.orbit-one::after { right: 12%; bottom: 18%; }
.orbit-two { width: 32vw; height: 32vw; right: -12vw; bottom: -8vw; }
.orbit-two::after { left: 12%; top: 20%; background: #8e88ff; }
@keyframes orbit-drift { to { transform: translate(2vw, 1vw) rotate(3deg); } }
.gate-card { align-self: center; padding: clamp(44px, 7vw, 96px); max-width: 640px; animation: gate-enter .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes gate-enter { from { opacity: 0; transform: translateY(20px); } }
.wordmark-gate { margin-bottom: 72px; }
.gate-card h1 { margin: 12px 0 22px; font-family: 'Avenir Next', 'PingFang SC', sans-serif; font-size: clamp(36px, 4vw, 58px); line-height: 1.18; letter-spacing: -.055em; }
.gate-copy { max-width: 430px; margin: 0 0 40px; color: var(--muted); line-height: 1.8; }
.gate-form { max-width: 430px; }
.gate-form > label:first-child, .modal label { display: grid; gap: 8px; color: #4d5660; font-size: 13px; font-weight: 600; }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 54px; }
.password-field .icon-button { position: absolute; right: 7px; top: 7px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
input:focus, textarea:focus, select:focus { border-color: #837df0; box-shadow: 0 0 0 4px #4f46e512; background: #fff; }
textarea { resize: vertical; line-height: 1.65; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; cursor: pointer; }
.consent input { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; accent-color: var(--violet); }
.primary-button, .secondary-button { border: 0; border-radius: 11px; padding: 12px 18px; font-weight: 700; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-button { background: var(--ink); color: white; box-shadow: 0 8px 22px #18212b22; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 12px 28px #18212b30; }
.secondary-button { background: var(--paper-deep); color: var(--ink); }
.gate-submit { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; }
.gate-footer { margin-top: 70px; color: #9a9f9f; font-family: 'Songti SC', 'STSong', Georgia, serif; font-style: italic; letter-spacing: .08em; }
.form-error { min-height: 18px; margin: 9px 0 0; color: var(--coral); font-size: 12px; }

.app-shell { min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; background: #efebe2; border-right: 1px solid var(--line); z-index: 30; }
.sidebar-head { height: 84px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; border-bottom: 1px solid var(--line); }
.version-tag { border: 1px solid #d3cec3; border-radius: 5px; color: var(--muted); font-size: 9px; padding: 3px 5px; }
.side-nav { display: grid; gap: 5px; padding: 22px 14px; }
.nav-item { min-height: 46px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 10px; padding: 0 13px; background: transparent; color: #59636d; text-align: left; font-weight: 600; }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { background: #ffffff80; color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--violet); box-shadow: var(--shadow-sm); }
.nav-count { margin-left: auto; min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 10px; background: var(--coral-soft); color: var(--coral); font-size: 10px; }
.sidebar-note { margin: auto 25px 28px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sidebar-note p { margin: 0 0 18px; font-family: 'Songti SC', 'STSong', Georgia, serif; font-size: 17px; font-style: italic; line-height: 1.7; }
.sidebar-note span { color: var(--muted); font-size: 10px; letter-spacing: .16em; }
.sidebar-foot { padding: 15px; border-top: 1px solid var(--line); }
.user-chip { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 7px; text-align: left; border-radius: 10px; }
.user-chip:hover { background: #fff8; }
.user-avatar, .profile-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); font-size: 18px; }
.user-chip span:last-child { display: grid; min-width: 0; }
.user-chip strong { font-size: 12px; }
.user-chip small { color: var(--muted); font-size: 10px; }

.workspace { min-height: 100dvh; margin-left: var(--sidebar); }
.topbar { height: 84px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 3vw, 48px); background: #f4f1eae8; border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.page-intro h1 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.command-search { width: min(30vw, 350px); height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: #ffffffa8; }
.command-search svg { width: 18px; flex: 0 0 auto; color: var(--muted); }
.command-search input { min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.command-search kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: background .2s, transform .2s; }
.icon-button:hover { background: var(--violet-soft); transform: translateY(-1px); }
.icon-button svg { width: 19px; height: 19px; }
.profile-button { height: 42px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); padding: 3px 12px 3px 4px; font-size: 12px; font-weight: 600; }
.profile-avatar { width: 32px; height: 32px; }
.mobile-brand { display: none; }

.content { max-width: 1680px; margin: 0 auto; padding: 15px clamp(18px, 3vw, 46px) 40px; }
.status-strip { min-height: 28px; display: flex; align-items: center; gap: 9px; margin-bottom: 13px; color: var(--muted); font-size: 11px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px #397a6014; }
.live-dot.closed { background: var(--amber); box-shadow: 0 0 0 4px #a76b1914; }
.strip-divider { height: 12px; width: 1px; background: var(--line); }
.refresh-countdown { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(210px, 1.15fr); gap: 12px; margin-bottom: 16px; }
.metric-card, .new-record-card { position: relative; min-height: 132px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card { padding: 18px; }
.metric-card > div:first-child { display: grid; gap: 4px; }
.metric-label { color: var(--muted); font-size: 11px; }
.metric-card strong { font-size: 28px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-card small { position: absolute; left: 18px; bottom: 15px; color: var(--muted); font-size: 10px; }
.metric-icon { position: absolute; width: 49px; height: 49px; right: 16px; top: 16px; padding: 10px; border-radius: 15px; }
.metric-ink .metric-icon { background: #edf0f1; color: var(--ink); }
.metric-coral .metric-icon { background: var(--coral-soft); color: var(--coral); }
.metric-ring { --value: 0; position: absolute; right: 19px; top: 18px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--sage) calc(var(--value) * 1%), #e5ebe7 0); }
.metric-ring::after { content: ''; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); }
.metric-spark { position: absolute; right: 15px; top: 24px; width: 72px; height: 33px; color: var(--violet); }
.metric-spark path { vector-effect: non-scaling-stroke; }
.new-record-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 18px; border: 0; background: var(--ink); color: white; text-align: left; }
.new-record-card::before { content: ''; position: absolute; width: 160px; height: 160px; right: -70px; top: -80px; border: 1px solid #ffffff1b; border-radius: 50%; }
.new-record-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.new-record-card span:nth-child(2) { display: grid; gap: 5px; }
.new-record-card small { color: #b9c0c5; font-size: 10px; }
.new-record-plus { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; background: var(--violet); font-size: 24px; font-weight: 400; }

.research-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 16px; }
.panel-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.view-switch { display: flex; padding: 3px; border-radius: 9px; background: var(--paper-deep); }
.view-switch button { width: 34px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); }
.view-switch button.active { background: var(--surface); color: var(--violet); box-shadow: 0 1px 5px #18212b14; }
.view-switch svg { width: 16px; }
.filter-bar { min-height: 55px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 22px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.filter-tabs { align-self: stretch; display: flex; gap: 22px; overflow-x: auto; }
.filter-tabs button { position: relative; border: 0; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.filter-tabs button::after { content: ''; position: absolute; inset: auto 0 -1px; height: 2px; background: transparent; }
.filter-tabs button.active { color: var(--ink); font-weight: 700; }
.filter-tabs button.active::after { background: var(--violet); }
.filter-tabs span { margin-left: 4px; color: #a1a8ad; }
.filter-actions { display: flex; gap: 8px; }
.filter-actions select { width: auto; min-width: 124px; padding: 8px 30px 8px 10px; border-radius: 8px; color: #59636d; font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1180px; border-collapse: collapse; }
th { padding: 12px 14px; background: var(--surface-2); color: #889098; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid var(--line-soft); font-size: 12px; vertical-align: middle; }
tbody tr { position: relative; transition: background .16s; }
tbody tr:hover { background: #f9f7f1; }
tbody tr.selected { background: var(--violet-soft); }
tbody tr.selected td:first-child { box-shadow: inset 3px 0 var(--violet); }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.stock-cell { display: grid; gap: 3px; min-width: 115px; cursor: pointer; }
.stock-cell strong { font-size: 13px; }
.stock-cell span, .muted { color: var(--muted); font-size: 10px; }
.author-cell { display: flex; align-items: center; gap: 7px; }
.mini-avatar { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-deep); }
.status-badge, .tag, .threshold-tag { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status-active { background: var(--violet-soft); color: var(--violet); }
.status-due { background: var(--amber-soft); color: var(--amber); }
.status-archived { background: #edf0ee; color: #68746f; }
.status-invalidated { background: var(--coral-soft); color: var(--coral); }
.thesis-cell { max-width: 330px; }
.thesis-cell p { overflow: hidden; margin: 0; color: #4f5962; text-overflow: ellipsis; white-space: nowrap; }
.tag { margin-top: 5px; padding: 3px 7px; background: #f0f1f1; color: #667078; }
.positive { color: var(--red-up); font-weight: 700; }
.negative { color: var(--green-down); font-weight: 700; }
.flat { color: var(--muted); font-weight: 600; }
.row-action { width: 31px; height: 31px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; }
.row-action:hover { background: var(--paper-deep); color: var(--ink); }
.card-grid { grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 12px; padding: 16px; background: var(--surface-2); }
.research-card { position: relative; display: grid; gap: 13px; min-height: 240px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: transform .2s, box-shadow .2s; cursor: pointer; }
.research-card::before { content: ''; position: absolute; inset: 16px auto 16px 0; width: 3px; border-radius: 2px; background: var(--violet); }
.research-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.card-head, .card-performance, .card-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-head h3 { margin: 0 0 3px; font-size: 16px; }
.card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.card-performance strong { font-size: 24px; }
.card-thesis { margin: 0; color: #59636d; font-size: 11px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 11px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.empty-state { min-height: 360px; place-items: center; align-content: center; text-align: center; padding: 50px 20px; }
.empty-state[hidden] { display: none; }
.empty-state:not([hidden]) { display: grid; }
.empty-orbit { width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle, var(--surface) 38%, transparent 39%), conic-gradient(from 25deg, var(--violet-soft), var(--coral-soft), var(--sage-soft), var(--violet-soft)); }
.empty-orbit span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-size: 24px; }
.empty-state h3 { margin: 0; font-size: 21px; }
.empty-state p { max-width: 420px; margin: 10px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.site-footer { display: grid; grid-template-columns: 180px 1fr; gap: 18px; margin-top: 20px; padding: 22px 4px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.site-footer strong { color: #555f67; }
.site-footer p { margin: 0; }
.mobile-fab { display: none; }

.drawer-backdrop { position: fixed; inset: 0; background: #18212b45; backdrop-filter: blur(3px); z-index: 50; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.detail-drawer { position: fixed; inset: 0 0 0 auto; width: min(520px, 92vw); z-index: 60; border: 0; border-left: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); animation: drawer-in .32s cubic-bezier(.2,.8,.2,1) both; overflow-y: auto; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: .5; } }
.drawer-handle { display: none; }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 22px 25px; border-bottom: 1px solid var(--line); background: #fffefaea; backdrop-filter: blur(15px); }
.drawer-header h2 { margin: 0; font-size: 23px; }
.drawer-content { padding: 24px 25px 60px; }
.detail-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.detail-code { color: var(--muted); font-size: 11px; }
.detail-price { text-align: right; }
.detail-price strong { display: block; font-size: 28px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.detail-section { padding: 22px 0; border-bottom: 1px solid var(--line-soft); }
.detail-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 11px; font-size: 12px; }
.detail-section h3::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--violet); }
.detail-section p { margin: 0; color: #53606a; font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-grid .detail-section { padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.detail-grid .detail-section:last-child h3::before { background: var(--coral); }
.detail-actions { display: flex; gap: 9px; margin-top: 22px; }
.detail-actions button { flex: 1; }
.note-form { display: flex; gap: 8px; margin-top: 12px; }
.note-list { display: grid; gap: 10px; margin-top: 13px; }
.note-item { padding: 11px 13px; border-left: 2px solid var(--line); background: var(--surface-2); font-size: 11px; line-height: 1.6; }
.note-item time { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }

dialog { border: 0; padding: 0; background: transparent; }
dialog::backdrop { background: #18212b66; backdrop-filter: blur(6px); }
.modal { width: min(620px, calc(100vw - 32px)); max-height: 92dvh; overflow: visible; }
.modal[open] { animation: modal-in .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-shell { max-height: 92dvh; overflow-y: auto; padding: 24px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-lg); }
.modal-shell.wide { width: min(880px, calc(100vw - 32px)); }
.record-modal { width: min(880px, calc(100vw - 32px)); }
.modal-header { display: flex; justify-content: space-between; gap: 22px; margin-bottom: 20px; }
.modal-header h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.04em; }
.modal-header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.segmented { display: flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 10px; background: var(--paper-deep); }
.segmented button { flex: 1; border: 0; border-radius: 8px; padding: 9px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px #18212b14; }
.member-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 15px; }
.member-option { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 10px; font-size: 11px; font-weight: 600; }
.member-option.selected { border-color: var(--violet); background: var(--violet-soft); color: var(--violet); }
.member-option span { font-size: 20px; }
.emoji-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin: 9px 0 16px; }
.emoji-grid button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 20px; }
.emoji-grid button.selected { border-color: var(--violet); background: var(--violet-soft); transform: translateY(-2px); }
.two-fields, .three-fields { display: grid; gap: 12px; }
.two-fields { grid-template-columns: repeat(2, 1fr); }
.three-fields { grid-template-columns: repeat(3, 1fr); }
.full { width: 100%; margin-top: 14px; }
.record-layout { display: grid; gap: 14px; }
.form-section { display: grid; grid-template-columns: 40px 190px 1fr; gap: 14px; align-items: start; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); }
.step-number { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--violet); font-size: 10px; font-weight: 700; }
.section-copy h3 { margin: 2px 0 5px; font-size: 14px; }
.section-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-section > label, .form-section > div:not(.section-copy) { grid-column: 3; }
.field-wide { grid-column: 3 !important; }
label span { color: var(--coral); font-size: 9px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 12px; top: 12px; width: 18px; color: var(--muted); }
.search-field input { padding-left: 40px; }
.stock-results { display: grid; gap: 4px; margin-top: 7px; }
.stock-result { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 9px 11px; font-size: 11px; text-align: left; }
.stock-result:hover { border-color: var(--violet); background: var(--violet-soft); }
.stock-result span:last-child { color: var(--muted); }
.selected-stock { align-items: center; justify-content: space-between; padding: 12px; border: 1px solid #b8d8ca; border-radius: 11px; background: var(--sage-soft); }
.selected-stock:not([hidden]) { display: flex; }
.selected-stock strong { display: block; }
.selected-stock span { color: var(--muted); font-size: 10px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.modal-actions p { margin-right: auto; color: var(--muted); font-size: 10px; }
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { min-width: 270px; display: flex; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink); color: white; box-shadow: var(--shadow-lg); font-size: 12px; animation: toast-in .3s both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1220px) {
  :root { --sidebar: 206px; }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .new-record-card { grid-column: 1 / -1; min-height: 76px; }
  .metric-card { min-height: 122px; }
  .thesis-cell { max-width: 250px; }
}

@media (max-width: 900px) {
  :root { --sidebar: 76px; }
  .sidebar-head { padding: 0; justify-content: center; }
  .sidebar-head .wordmark { font-size: 0; }
  .sidebar-head .wordmark-dot { width: 14px; height: 14px; }
  .version-tag, .nav-item span:not(.nav-count), .sidebar-note, .user-chip span:last-child { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-count { position: absolute; margin: 0 0 23px 23px; }
  .user-chip { justify-content: center; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .new-record-card { grid-column: auto; min-height: 122px; }
  .filter-bar { align-items: flex-end; flex-direction: column; padding: 10px 16px; }
  .filter-tabs { width: 100%; min-height: 42px; }
  .filter-actions { width: 100%; }
  .filter-actions select { flex: 1; }
}

@media (max-width: 700px) {
  :root { --sidebar: 0px; --radius: 15px; }
  .access-gate { grid-template-columns: 1fr; }
  .gate-atmosphere { position: absolute; inset: 0; opacity: .09; }
  .gate-card { position: relative; padding: 34px 24px; }
  .wordmark-gate { margin-bottom: 72px; }
  .gate-card h1 { font-size: 38px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .topbar { height: 66px; padding: 0 16px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; font-size: 14px; font-weight: 700; letter-spacing: .1em; }
  .page-intro, .command-search, #logoutButton, .profile-name, .profile-button > span:last-child { display: none; }
  .profile-button { padding: 3px; border: 0; background: transparent; }
  .content { padding: 10px 12px calc(env(safe-area-inset-bottom) + 96px); }
  .status-strip { margin: 0 4px 10px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .metric-card, .new-record-card { min-height: 104px; border-radius: 14px; }
  .metric-card { padding: 14px; }
  .metric-card strong { font-size: 24px; }
  .metric-card small { left: 14px; bottom: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metric-icon, .metric-ring, .metric-spark { transform: scale(.78); transform-origin: top right; }
  .new-record-card { display: none; }
  .research-panel { box-shadow: none; }
  .panel-heading { padding: 17px 15px 13px; }
  .filter-bar { padding: 0 13px 11px; gap: 9px; }
  .filter-tabs { min-height: 44px; gap: 18px; }
  .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .table-wrap { display: none !important; }
  .card-grid { display: grid !important; grid-template-columns: 1fr; padding: 10px; }
  .research-card { min-height: 220px; }
  .view-switch { display: none; }
  .site-footer { grid-template-columns: 1fr; padding: 18px 8px; }
  .mobile-fab { position: fixed; right: 18px; bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 35; width: 56px; height: 56px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--violet); color: white; box-shadow: 0 12px 30px #4f46e54d; font-size: 30px; }
  .detail-drawer { inset: auto 0 0; width: 100%; max-height: 92dvh; border: 0; border-radius: 20px 20px 0 0; animation-name: drawer-up; }
  @keyframes drawer-up { from { transform: translateY(40px); opacity: .5; } }
  .drawer-handle { display: block; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: var(--line); }
  .drawer-header { padding: 14px 18px; }
  .drawer-content { padding: 18px 18px calc(env(safe-area-inset-bottom) + 35px); }
  .detail-grid { grid-template-columns: 1fr; }
  .modal { width: 100%; max-width: none; max-height: 94dvh; margin: auto 0 0; }
  .modal-shell, .modal-shell.wide { width: 100%; max-height: 94dvh; padding: 20px 16px calc(env(safe-area-inset-bottom) + 22px); border-radius: 20px 20px 0 0; }
  .record-modal { width: 100%; max-width: none; }
  .member-list { grid-template-columns: repeat(2, 1fr); }
  .emoji-grid { grid-template-columns: repeat(7, 1fr); }
  .two-fields, .three-fields { grid-template-columns: 1fr; }
  .form-section { grid-template-columns: 36px 1fr; padding: 14px; }
  .form-section > label, .form-section > div:not(.section-copy), .field-wide { grid-column: 1 / -1 !important; }
  .modal-actions { position: sticky; bottom: -22px; margin-inline: -16px; padding: 13px 16px calc(env(safe-area-inset-bottom) + 13px); background: #fffefaf2; border-top: 1px solid var(--line); backdrop-filter: blur(15px); }
  .modal-actions p { display: none; }
  .toast-stack { left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 84px); }
  .toast { min-width: 0; }
}

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