:root {
  color-scheme: light;
  --navy: #102a56;
  --navy-2: #173b74;
  --blue: #2563eb;
  --blue-soft: #eef5ff;
  --cyan: #0ea5c6;
  --ink: #17233d;
  --muted: #66738a;
  --line: #dce4ef;
  --surface: #ffffff;
  --canvas: #f3f6fb;
  --green: #14966b;
  --green-soft: #e9f8f1;
  --amber: #b86d00;
  --amber-soft: #fff5dd;
  --red: #c53f45;
  --red-soft: #fff0f1;
  --shadow: 0 18px 48px rgba(22, 42, 79, 0.12);
  --radius: 18px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
.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; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 12% 12%, rgba(62, 211, 207, .24), transparent 30%),
    radial-gradient(circle at 88% 85%, rgba(85, 131, 255, .25), transparent 34%),
    linear-gradient(145deg, #0a2045, #163d73 62%, #0f5673);
}
.auth-card { width: min(100%, 430px); padding: 32px 26px; border-radius: 26px; background: rgba(255,255,255,.97); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.auth-card h1 { margin: 0 0 10px; font-size: 31px; letter-spacing: -.04em; }
.auth-card > .muted { margin: 0 0 24px; line-height: 1.65; }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 22px; border-radius: 16px; color: #fff; font-size: 23px; font-weight: 900; background: linear-gradient(145deg, #2b68ee, #0c9fc2); box-shadow: 0 12px 24px rgba(37,99,235,.27); }

.stack-form { display: grid; gap: 18px; }
.stack-form label > span, fieldset legend { display: block; margin-bottom: 8px; color: #34415a; font-size: 14px; font-weight: 700; }
.stack-form em { color: var(--red); font-size: 12px; font-style: normal; }
.stack-form label > small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
input, select { width: 100%; min-height: 46px; padding: 0 14px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; outline: none; background: #fff; transition: border-color .18s, box-shadow .18s; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.11); }
input::placeholder { color: #a2acbb; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 800; transition: transform .15s, box-shadow .15s, background .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { color: #fff; background: linear-gradient(135deg, #2563eb, #167caf); box-shadow: 0 8px 18px rgba(37,99,235,.2); }
.button-primary:not(:disabled):hover { box-shadow: 0 11px 24px rgba(37,99,235,.3); }
.button-secondary { color: var(--navy); border-color: var(--line); background: #fff; }
.button-secondary:hover { border-color: #b9c6da; background: #f8faff; }
.button-danger { color: #fff; background: var(--red); }
.button-block { width: 100%; }
.text-button, .icon-button, .close-button { border: 0; background: transparent; }
.text-button { padding: 8px; color: #667792; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; color: #60718d; border-radius: 10px; }
.icon-button:hover { background: #edf2f8; }
.icon-button svg, .search-field svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.topbar { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid rgba(220,228,239,.8); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.topbar-inner { width: min(1180px, calc(100% - 32px)); min-height: 68px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-inline { display: flex; align-items: center; gap: 12px; }
.brand-inline strong { display: block; color: var(--navy); font-size: 17px; }
.brand-inline small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-dot { width: 11px; height: 34px; border-radius: 8px; background: linear-gradient(#33c7d9, #2563eb); }
.topbar-actions { display: flex; align-items: center; gap: 5px; }
.account-name { max-width: 140px; margin-right: 3px; overflow: hidden; color: #5c6b82; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.content { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 60px; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.hero-row h1 { margin: 0 0 8px; color: var(--navy); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.05em; }
.hero-row p:last-child { margin: 0; font-size: 13px; }
.button-new { min-height: 50px; padding: 0 24px; font-size: 16px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.summary-card { display: flex; align-items: center; gap: 15px; min-height: 108px; padding: 20px; text-align: left; border: 1px solid transparent; border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 25px rgba(31,57,96,.07); transition: transform .16s, box-shadow .16s, border-color .16s; }
.summary-card:hover { transform: translateY(-2px); border-color: #cbd7e7; box-shadow: 0 12px 28px rgba(31,57,96,.11); }
.summary-card b { display: block; color: var(--navy); font-size: 30px; line-height: 1; }
.summary-card small { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; }
.summary-icon { display: grid; place-items: center; width: 45px; height: 45px; flex: 0 0 45px; border-radius: 14px; font-weight: 900; }
.summary-waiting .summary-icon { color: var(--amber); background: var(--amber-soft); }
.summary-running .summary-icon { color: var(--blue); background: var(--blue-soft); }
.summary-done .summary-icon { color: var(--green); background: var(--green-soft); }
.summary-error .summary-icon { color: var(--red); background: var(--red-soft); }

.panel { border: 1px solid rgba(220,228,239,.85); border-radius: 22px; background: var(--surface); box-shadow: 0 12px 36px rgba(31,57,96,.08); }
.orders-panel { padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-heading h2 { margin: 0 0 5px; color: var(--navy); font-size: 21px; }
.panel-heading p { margin: 0; font-size: 13px; }
.order-view-tabs { display: flex; gap: 24px; min-height: 42px; margin-top: 15px; border-bottom: 1px solid var(--line); }
.order-view-tab { position: relative; min-width: 72px; padding: 0 2px; color: var(--muted); border: 0; background: transparent; font-weight: 800; }
.order-view-tab::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 3px; content: ""; background: transparent; }
.order-view-tab.active { color: var(--blue); }
.order-view-tab.active::after { background: var(--blue); }
.filters { display: grid; grid-template-columns: minmax(240px, 1fr) 170px 150px auto; gap: 10px; margin: 20px 0; }
.filters.archived-view { grid-template-columns: minmax(240px, 1fr) 170px auto; }
.search-field { position: relative; }
.search-field svg { position: absolute; top: 13px; left: 14px; color: #8390a4; }
.search-field input { padding-left: 44px; }
.filter-submit { padding-inline: 24px; }

.table-wrap { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th { padding: 13px 12px; color: #748198; font-size: 12px; font-weight: 800; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.orders-table td { padding: 16px 12px; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.orders-table tbody tr { transition: background .15s; }
.orders-table tbody tr:hover { background: #f8faff; }
.order-primary { display: block; max-width: 290px; overflow: hidden; color: var(--navy); font-size: 16px; font-weight: 900; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.order-secondary { display: block; max-width: 290px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.tag, .status { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.tag-effective { color: #6b4a00; background: #fff3c7; }
.tag-real { color: #135a7d; background: #dff5ff; }
.tag-toutiao { color: #843a2e; background: #ffe8df; }
.status::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; content: ""; background: currentColor; }
.status-waiting { color: var(--amber); background: var(--amber-soft); }
.status-running { color: var(--blue); background: var(--blue-soft); }
.status-attention { color: #8a5100; background: #fff0cd; box-shadow: inset 0 0 0 1px #f0cf88; }
.status-done { color: var(--green); background: var(--green-soft); }
.status-error { color: var(--red); background: var(--red-soft); }
.status-muted { color: #657288; background: #edf1f6; }
.progress-line { width: 260px; min-width: 220px; }
.progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress-heading b { min-width: 0; overflow: hidden; color: var(--navy); font-size: 14px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.progress-percent { min-width: 39px; padding: 3px 7px; color: #40516c; border-radius: 7px; font-size: 11px; font-weight: 800; text-align: center; background: #f0f4fa; }
.progress-track { height: 10px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #e9eef5; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #28b7c8, #2563eb); }
.progress-meta { margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.progress-pending .progress-fill { background: #aeb9c9; }
.progress-complete:not(.progress-prerequisite) .progress-fill { background: linear-gradient(90deg, #20a879, #14966b); }
.progress-prerequisite .progress-fill { background: linear-gradient(90deg, #e0a022, #16867a); }
.view-button { padding: 8px 12px; color: var(--blue); border: 0; border-radius: 9px; font-weight: 800; background: var(--blue-soft); white-space: nowrap; }

.loading-state, .empty-state { display: grid; place-items: center; min-height: 250px; padding: 35px; text-align: center; color: var(--muted); }
.loading-state p, .empty-state p { margin: 12px 0 0; }
.empty-state h3 { margin: 14px 0 0; color: var(--navy); }
.empty-state .button { margin-top: 20px; }
.empty-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; color: var(--blue); font-size: 24px; font-weight: 900; background: var(--blue-soft); }
.spinner { width: 30px; height: 30px; border: 3px solid #dce7f5; border-top-color: var(--blue); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; padding-top: 20px; }
.pagination span { color: var(--muted); font-size: 13px; }
.order-cards { display: none; }
.mobile-only { display: none; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; background: rgba(10,24,51,.5); backdrop-filter: blur(3px); }
.modal { position: fixed; z-index: 60; top: 50%; left: 50%; width: min(620px, calc(100% - 28px)); max-height: min(88vh, 860px); overflow: auto; transform: translate(-50%, -50%); border-radius: 24px; background: #fff; box-shadow: 0 32px 90px rgba(7,20,45,.32); }
.modal-small { width: min(500px, calc(100% - 28px)); }
.modal-header, .drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px 26px 17px; border-bottom: 1px solid #edf1f6; }
.modal-header h2, .drawer-header h2 { margin: 0; color: var(--navy); font-size: 23px; }
.modal-body { padding: 22px 26px 27px; }
.close-button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; color: #69778c; border-radius: 50%; font-size: 27px; line-height: 1; }
.close-button:hover { color: var(--navy); background: #edf2f8; }
.choice-grid { display: grid; gap: 9px; }
.choice-business { grid-template-columns: repeat(3, 1fr); }
.choice-target { grid-template-columns: repeat(4, 1fr); }
.choice-card { position: relative; cursor: pointer; }
.choice-card input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice-card > span { display: grid !important; place-items: center; min-height: 68px; margin: 0 !important; padding: 10px; text-align: center; border: 1px solid var(--line); border-radius: 13px; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice-card b { display: block; color: var(--navy); font-size: 15px; }
.choice-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.choice-card input:checked + span { border-color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px var(--blue); }
.choice-card input:focus-visible + span { outline: 3px solid rgba(37,99,235,.2); }
.custom-target { padding: 13px; border-radius: 13px; background: #f6f8fc; }
.notice { padding: 13px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.notice-info { color: #28537a; background: #edf7ff; }
.notice-warn { color: #755000; background: var(--amber-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.warning-text { color: var(--red); }
.duplicate-list { display: grid; gap: 9px; margin: 18px 0; }
.duplicate-item { padding: 13px; border: 1px solid #f1d7d9; border-radius: 12px; background: #fff8f8; }
.duplicate-item b { display: block; color: var(--navy); }
.duplicate-item small { display: block; margin-top: 5px; color: var(--muted); }

.drawer { position: fixed; z-index: 60; top: 0; right: 0; width: min(680px, 100%); height: 100vh; height: 100dvh; overflow: hidden; background: #f6f8fc; box-shadow: -25px 0 70px rgba(7,20,45,.22); }
.drawer-header { background: #fff; }
.drawer-body { height: calc(100% - 165px); padding: 22px; overflow-y: auto; }
.drawer-actions { min-height: 82px; display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.drawer-actions .danger-link { margin-right: auto; color: var(--red); border-color: #f0cdd0; }
.detail-section { margin-bottom: 17px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.detail-section h3 { margin: 0 0 16px; color: var(--navy); font-size: 16px; }
.detail-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-schedule { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.detail-field { min-width: 0; }
.detail-field dt { color: var(--muted); font-size: 12px; }
.detail-field dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 700; }
.metric-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric-box { padding: 14px; border-radius: 14px; background: #f5f8fc; }
.metric-box span { display: block; color: var(--muted); font-size: 12px; }
.metric-box b { display: block; margin-top: 7px; color: var(--navy); font-size: 23px; }
.metric-box .metric-state { font-size: 15px; line-height: 1.4; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-section .section-heading h3 { margin: 0; }
.prerequisite-section { border-left: 4px solid #e0a022; }
.prerequisite-progress { margin-top: 16px; }
.prerequisite-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.prerequisite-alert { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #ead8ac; }
.prerequisite-alert b { color: #704600; }
.prerequisite-alert p { margin: 5px 0 0; color: #695d48; font-size: 12px; line-height: 1.5; }
.screenshots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.screenshot-card { width: 100%; padding: 0; overflow: hidden; color: inherit; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: #f1f4f8; transition: border-color .15s, box-shadow .15s, transform .15s; }
.screenshot-card:hover { border-color: #aebed5; box-shadow: 0 8px 22px rgba(17, 42, 86, .1); }
.screenshot-card:active { transform: translateY(1px); }
.screenshot-card:focus-visible { outline: 3px solid rgba(37,99,235,.25); outline-offset: 2px; }
.screenshot-thumbnail { position: relative; display: block; overflow: hidden; }
.screenshot-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #e8edf4; transition: transform .2s; }
.screenshot-card:hover img { transform: scale(1.015); }
.screenshot-open-hint { position: absolute; right: 9px; bottom: 9px; min-height: 28px; padding: 5px 9px; color: #fff; border-radius: 6px; font-size: 11px; font-weight: 800; background: rgba(10,24,51,.78); backdrop-filter: blur(4px); }
.screenshot-meta { padding: 10px; }
.screenshot-meta b { display: block; overflow: hidden; color: var(--navy); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.screenshot-meta small { display: block; margin-top: 4px; color: var(--muted); }

.image-viewer { position: fixed; z-index: 80; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; color: #fff; background: rgba(5, 12, 25, .97); }
.image-viewer-header { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; align-items: center; gap: 14px; min-height: 72px; padding: calc(12px + env(safe-area-inset-top)) 18px 12px; border-bottom: 1px solid rgba(255,255,255,.14); background: rgba(8, 17, 34, .92); }
.image-viewer-heading { min-width: 0; }
.image-viewer-heading h2 { margin: 0; overflow: hidden; font-size: 16px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer-heading p { margin: 4px 0 0; overflow: hidden; color: #aebbd0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer-counter { min-width: 58px; color: #dbe5f4; font-size: 13px; font-weight: 800; text-align: center; }
.image-viewer-stage { position: relative; display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; touch-action: none; user-select: none; cursor: zoom-in; }
.image-viewer-stage.is-zoomed { cursor: grab; }
.image-viewer-stage.is-zoomed:active { cursor: grabbing; }
.image-viewer-image { display: block; max-width: calc(100% - 128px); max-height: calc(100% - 28px); object-fit: contain; transform-origin: center; will-change: transform; -webkit-user-drag: none; user-select: none; }
.image-viewer-image.is-loading { opacity: 0; }
.image-viewer-loading, .image-viewer-error { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; gap: 12px; min-width: min(320px, calc(100% - 40px)); padding: 22px; text-align: center; transform: translate(-50%, -50%); }
.image-viewer-loading { color: #c7d3e4; font-size: 13px; }
.image-viewer-loading .spinner { border-color: rgba(255,255,255,.22); border-top-color: #fff; }
.image-viewer-error { color: #dce6f4; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: rgba(18,30,51,.88); }
.image-viewer-error b { font-size: 16px; }
.image-viewer-error span { color: #aebbd0; font-size: 12px; }
.image-viewer-nav, .image-viewer-icon { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(28,42,66,.82); }
.image-viewer-nav:hover, .image-viewer-icon:hover { background: rgba(53,72,103,.96); }
.image-viewer-nav:focus-visible, .image-viewer-icon:focus-visible, .image-viewer-text-button:focus-visible { outline: 3px solid rgba(119,168,255,.7); outline-offset: 2px; }
.image-viewer-nav:disabled, .image-viewer-icon:disabled { opacity: .3; }
.image-viewer-nav svg, .image-viewer-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.image-viewer-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); }
.image-viewer-previous { left: 18px; }
.image-viewer-next { right: 18px; }
.image-viewer-toolbar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 70px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.14); background: rgba(8, 17, 34, .94); }
.image-viewer-zoom-controls, .image-viewer-file-actions { display: flex; align-items: center; gap: 9px; }
.image-viewer-zoom-label { min-width: 54px; color: #e7eef9; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 800; text-align: center; }
.image-viewer-text-button { display: inline-flex; min-height: 44px; padding: 0 13px; align-items: center; justify-content: center; color: #e8f0fb; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; font-size: 13px; font-weight: 800; text-decoration: none; background: rgba(28,42,66,.82); }
.image-viewer-text-button:hover { background: rgba(53,72,103,.96); }
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 11px; padding-bottom: 19px; }
.timeline-item:not(:last-child)::before { position: absolute; top: 13px; bottom: -2px; left: 6px; width: 2px; content: ""; background: #dce5f1; }
.timeline-dot { z-index: 1; width: 14px; height: 14px; margin-top: 2px; border: 3px solid #d8e6ff; border-radius: 50%; background: var(--blue); }
.timeline-copy b { display: block; color: #34415a; font-size: 13px; }
.timeline-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.detail-error { margin-bottom: 17px; color: #8b2c34; background: var(--red-soft); }
.detail-loading { min-height: 400px; }
.material-list { display: grid; gap: 20px; }
.material-card { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.material-card:last-child { padding-bottom: 0; border-bottom: 0; }
.material-card-preview { padding-left: 13px; border-left: 4px solid var(--amber); }
.material-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.material-card-head small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.material-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--navy); }
.preview-badge, .publishable-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.preview-badge { color: #815200; background: var(--amber-soft); }
.publishable-badge { color: #0c7553; background: var(--green-soft); }
.notice-preview { margin-top: 13px; color: #704900; background: var(--amber-soft); }
.material-subsection { margin-top: 17px; }
.material-subsection > b { display: block; margin-bottom: 9px; color: #34415a; font-size: 13px; }
.material-subsection > p { margin: 0; font-size: 12px; }
.evidence-pairs { display: grid; gap: 8px; }
.evidence-pair { display: grid; grid-template-columns: minmax(120px, 1fr) auto 18px auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid #edf1f6; font-size: 12px; }
.evidence-pair:first-child { border-top: 0; }
.evidence-pair div > b, .evidence-pair div > small { display: block; }
.evidence-pair div > small { margin-top: 3px; color: var(--muted); }
.evidence-pair a { color: var(--blue); text-decoration: none; }
.evidence-pair code { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.material-assets { display: grid; gap: 9px; }
.material-asset { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.material-asset img, .asset-pending { width: 58px; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #edf1f6; }
.asset-pending { display: grid; place-items: center; color: var(--muted); font-size: 10px; text-align: center; }
.material-asset b, .material-asset small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-asset b { color: var(--navy); font-size: 12px; }
.material-asset small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.asset-download { display: inline-flex; align-items: center; min-height: 36px; text-decoration: none; }
.material-state-row { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.material-actions-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.material-actions-inline:empty { display: none; }
.material-actions-inline .button { min-height: 38px; padding-inline: 13px; font-size: 12px; }
.material-empty > b { color: var(--navy); }
.material-empty > p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.toast-region { position: fixed; z-index: 100; top: 18px; right: 18px; display: grid; gap: 9px; width: min(390px, calc(100% - 36px)); }
.toast { padding: 14px 16px; color: #fff; border-radius: 13px; box-shadow: 0 15px 34px rgba(7,20,45,.24); animation: toast-in .22s ease-out; }
.toast-success { background: #147b5c; }
.toast-error { background: #b7353d; }
.toast-info { background: var(--navy-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 860px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .topbar-inner, .content { width: min(100% - 24px, 1180px); }
  .topbar-inner { min-height: 62px; }
  .brand-inline small, .account-name { display: none; }
  .content { padding-top: 24px; }
  .hero-row { align-items: start; margin-bottom: 20px; }
  .hero-row h1 { font-size: 28px; }
  .button-new { display: none; }
  .mobile-only { display: inline-flex; align-items: center; }
  .summary-grid { gap: 9px; }
  .summary-card { min-height: 88px; padding: 14px; gap: 11px; }
  .summary-card b { font-size: 25px; }
  .summary-icon { width: 39px; height: 39px; flex-basis: 39px; border-radius: 12px; }
  .orders-panel { margin-inline: -12px; padding: 19px 12px; border-right: 0; border-left: 0; border-radius: 0; }
  .filters { grid-template-columns: 1fr 1fr; margin: 16px 0; }
  .filters.archived-view { grid-template-columns: 1fr 1fr; }
  .filter-submit { display: none; }
  .table-wrap { display: none !important; }
  .order-cards:not(.hidden) { display: grid; gap: 11px; }
  .order-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 7px 18px rgba(31,57,96,.06); }
  .order-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .order-card .order-primary { max-width: min(230px, calc(100vw - 135px)); font-size: 16px; }
  .order-card .order-secondary { max-width: min(250px, calc(100vw - 115px)); }
  .order-card-tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0; }
  .order-card .progress-line { width: 100%; min-width: 0; }
  .order-card .progress-heading b { font-size: 15px; }
  .order-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 13px; border-top: 1px solid #edf1f6; }
  .order-card-bottom small { color: var(--muted); }
  .prerequisite-alert { align-items: stretch; flex-direction: column; }
  .prerequisite-alert .button { width: 100%; }
  .choice-business { grid-template-columns: 1fr; }
  .choice-business .choice-card > span { min-height: 57px; place-items: center start; text-align: left; }
  .choice-target { grid-template-columns: repeat(2, 1fr); }
  .modal { top: auto; bottom: 0; width: 100%; max-height: 92vh; transform: none; left: 0; border-radius: 24px 24px 0 0; }
  .modal-header { padding: 21px 20px 15px; }
  .modal-body { padding: 19px 20px calc(22px + env(safe-area-inset-bottom)); }
  .drawer-body { padding: 14px 12px; }
  .drawer-actions { justify-content: stretch; padding-inline: 12px; overflow-x: auto; }
  .drawer-actions .button { flex: 0 0 auto; }
  .detail-section { padding: 17px 15px; }
  .metric-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-box { padding: 11px 8px; }
  .metric-box b { font-size: 19px; }
  .prerequisite-metrics .metric-box:last-child { grid-column: 1 / -1; }
  .screenshots { grid-template-columns: 1fr; }
  .evidence-pair { grid-template-columns: 1fr 1fr; }
  .evidence-pair > div { grid-column: 1 / -1; }
  .evidence-pair > span { display: none; }
  .material-card-head { align-items: flex-start; }
  .material-asset { grid-template-columns: 52px minmax(0, 1fr); }
  .material-asset img, .asset-pending { width: 52px; }
  .material-asset .asset-download { grid-column: 1 / -1; justify-content: center; }
  .image-viewer-header { grid-template-columns: minmax(0, 1fr) auto 44px; gap: 7px; min-height: 64px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; }
  .image-viewer-heading h2 { font-size: 14px; }
  .image-viewer-heading p { font-size: 11px; }
  .image-viewer-counter { min-width: 44px; font-size: 12px; }
  .image-viewer-image { max-width: calc(100% - 24px); max-height: calc(100% - 20px); }
  .image-viewer-nav { top: auto; bottom: 12px; transform: none; background: rgba(20,35,59,.92); }
  .image-viewer-previous { left: 12px; }
  .image-viewer-next { right: 12px; }
  .image-viewer-toolbar { min-height: 64px; padding: 9px 10px calc(9px + env(safe-area-inset-bottom)); gap: 8px; }
  .image-viewer-zoom-controls, .image-viewer-file-actions { gap: 6px; }
  .image-viewer-toolbar .image-viewer-icon { width: 40px; height: 40px; }
  .image-viewer-zoom-label { min-width: 43px; font-size: 12px; }
  .image-viewer-text-button { min-height: 40px; padding-inline: 10px; font-size: 12px; }
}

@media (max-width: 410px) {
  .summary-card { gap: 8px; padding: 12px 10px; }
  .summary-card small { font-size: 12px; }
  .summary-icon { display: none; }
  .filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .detail-summary { grid-template-columns: 1fr; }
  .image-viewer-zoom-controls .image-viewer-text-button { width: 40px; padding: 0; overflow: hidden; font-size: 0; }
  .image-viewer-zoom-controls .image-viewer-text-button::before { content: "适应"; font-size: 11px; }
  .image-viewer-file-actions .image-viewer-text-button { width: 40px; padding: 0; overflow: hidden; font-size: 0; }
  .image-viewer-file-actions .image-viewer-text-button::before { content: "原图"; font-size: 11px; }
}

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