/* ==========================================================================
   星河企业查询 · 全局样式（单一主题）
   覆盖：搜索页 (index.html)  / 详情页 (detail.html)
   ========================================================================== */

/* ---- 设计令牌 ---------------------------------------------------------- */
:root {
    --brand: #2b60f0;
    --brand-strong: #1c47c7;
    --brand-ink: #0b1d4a;

    --ink: #17233a;
    --ink-soft: #4b5a70;
    --muted: #7b8aa0;

    --line: #e5eaf2;
    --line-strong: #d4dde9;
    --surface: #ffffff;
    --surface-soft: #f6f8fc;
    --bg: #f2f5fa;

    --success: #1e9a5c;
    --success-soft: #e7f6ee;
    --warn: #b7791f;
    --warn-soft: #fff7e6;
    --danger: #d64545;
    --danger-soft: #fdeeee;

    --font-display: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-data: "DIN Alternate", Bahnschrift, "Segoe UI", "Roboto Mono", Consolas, monospace;

    --shadow-sm: 0 1px 2px rgba(16, 32, 60, 0.05), 0 1px 3px rgba(16, 32, 60, 0.04);
    --shadow-md: 0 12px 32px rgba(16, 32, 60, 0.1);
    --shadow-lg: 0 24px 60px rgba(9, 25, 80, 0.28);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ---- 基础 -------------------------------------------------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.search-page,
body.detail-page {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
    outline: 3px solid rgba(43, 96, 240, 0.28);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- 头部（品牌优先）----------------------------------------------------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-container {
    width: min(100% - 32px, 1120px);
    min-height: 64px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-page .header-container { justify-content: space-between; }

.search-page .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-page .logo-img {
    height: 34px;
    width: auto;
    display: block;
}

.search-page .brand-name {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--brand-ink);
}

.search-page .header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.search-page .header-badge i { color: var(--success); }

/* ---- 详情页头部 -------------------------------------------------------- */
.detail-page .header-container {
    position: relative;
    justify-content: space-between;
}

.detail-page .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
}

.detail-page .back-btn:hover {
    color: var(--brand);
    background: var(--surface-soft);
}

.detail-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.detail-brand img { height: 34px; width: auto; display: block; }

.copy-detail-btn {
    min-width: 112px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--brand);
    font-size: 14px;
    font-weight: 600;
}

.copy-detail-btn:hover:not(:disabled) {
    border-color: var(--brand);
    background: var(--surface-soft);
}

.copy-detail-btn:disabled { opacity: 0.55; cursor: wait; }

.copy-detail-btn.copied {
    border-color: #a8d4bd;
    background: var(--success-soft);
    color: var(--success);
}

/* ---- 搜索页 · 主视觉（全宽巨幕）----------------------------------------- */
.search-page .hero {
    position: relative;
    padding: 64px 16px 58px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(1000px 480px at 50% -12%, rgba(88, 126, 255, 0.5), transparent 65%),
        radial-gradient(720px 340px at 84% 10%, rgba(74, 108, 245, 0.42), transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='20' cy='30' r='1' fill-opacity='0.5'/%3E%3Ccircle cx='72' cy='14' r='0.8' fill-opacity='0.42'/%3E%3Ccircle cx='122' cy='52' r='1.2' fill-opacity='0.34'/%3E%3Ccircle cx='40' cy='88' r='0.7' fill-opacity='0.5'/%3E%3Ccircle cx='138' cy='112' r='1' fill-opacity='0.4'/%3E%3Ccircle cx='90' cy='142' r='0.8' fill-opacity='0.38'/%3E%3Ccircle cx='12' cy='140' r='0.9' fill-opacity='0.45'/%3E%3Ccircle cx='150' cy='22' r='0.6' fill-opacity='0.5'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(180deg, #0a1740 0%, #0f256f 54%, #153591 100%);
    background-size: auto, auto, 160px 160px, auto;
}

.search-page .hero-content {
    position: relative;
    z-index: 2;
    width: min(100%, 860px);
    margin: 0 auto;
    text-align: center;
}

.search-page .hero-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: 1px;
    color: #fff;
}

.search-page .hero-subtitle {
    margin: 14px 0 0;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.8);
}

.search-page .workspace-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
}

.search-page .workspace-note i { color: #8ff0c0; }

.note-divider {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
}

/* 切换标签（分段控件） */
.search-page .tab-bar {
    display: flex;
    justify-content: center;
    margin: 34px 0 18px;
}

.search-page .tab {
    position: relative;
    display: inline-flex;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.search-page .tab-item {
    position: relative;
    z-index: 1;
    min-width: 132px;
    padding: 9px 22px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.search-page .tab-item.active { color: var(--brand-ink); }

.search-page .tab-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: calc(50% - 4px);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(9, 25, 80, 0.22);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

/* 搜索框（主视觉锚点） */
.search-page .tab-content { width: 100%; }

.search-page .search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 64px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-lg);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.search-page .search-box:focus-within {
    box-shadow: 0 0 0 4px rgba(120, 150, 255, 0.55), var(--shadow-lg);
    transform: translateY(-1px);
}

.search-page .search-input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    outline: none;
}

.search-page .search-input::placeholder { color: var(--muted); }

.search-page .search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 128px;
    min-height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: background 0.2s ease;
}

.search-page .search-btn:hover { background: var(--brand-strong); }

.search-page .search-btn:disabled { opacity: 0.8; cursor: wait; }

.search-spinner { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 搜索建议 */
.search-page .suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-md);
    text-align: left;
}

.search-page .suggestion-item {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    color: var(--ink-soft);
    font-size: 15px;
    transition: background 0.15s ease;
}

.search-page .suggestion-item:last-child { border-bottom: 0; }
.search-page .suggestion-item:hover { background: var(--surface-soft); color: var(--brand); }

/* 筛选区 */
.search-page .search-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-align: left;
}

.search-page .search-filters .filters-label {
    grid-column: 1 / span 3;
    grid-row: 1;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    user-select: none;
}

.search-page .search-filters .filters-label:hover { color: #fff; }

.search-page .search-filters .filters-label .toggle-icon {
    margin-left: 2px;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.search-page .search-filters.collapsed .filters-label .toggle-icon { transform: rotate(-90deg); }
.search-page .search-filters.collapsed .filter-item,
.search-page .search-filters.collapsed .filter-reset { display: none; }

.search-page .search-filters .filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.search-page .search-filters .filter-item > label {
    flex: 0 0 auto;
    min-width: 56px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.search-page .search-filters select,
.search-page .search-filters input[type="number"] {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 14px;
    outline: none;
}

.search-page .search-filters select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 26px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7a90' d='M2 5l6 6 6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
}

.search-page .search-filters input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.search-page .search-filters input[type="number"]::-webkit-outer-spin-button,
.search-page .search-filters input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.search-page .search-filters select:focus,
.search-page .search-filters input[type="number"]:focus {
    border-color: var(--brand);
    background: #fff;
}

.search-page .search-filters .filter-sep,
.search-page .search-filters .filter-unit {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
}

.search-page .search-filters .filter-count {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    margin-left: 2px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.search-page .search-filters .filter-reset {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    min-height: 38px;
    padding: 7px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.search-page .search-filters .filter-reset:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.26);
}

/* 常用搜索 */
.search-page .hot-search {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.search-page .hot-search-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
}

.search-page .hot-search-item {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    transition: all 0.15s ease;
}

.search-page .hot-search-item::before {
    content: "#";
    margin-right: 2px;
    color: rgba(255, 255, 255, 0.55);
}

.search-page .hot-search-item:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* ---- 搜索结果（列表形式，非卡片）--------------------------------------- */
.search-page .search-results {
    width: 100%;
    padding-bottom: 48px;
}

.search-page .results-container {
    width: min(100% - 32px, 1040px);
    margin: 0 auto;
    padding-top: 24px;
}

.search-page .results-container:empty { padding: 0; }

.result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 54px;
    margin-bottom: 12px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    background: #fff;
}

.search-page .search-stats {
    color: var(--ink-soft);
    font-size: 14px;
}

.search-page .search-stats b {
    color: var(--brand);
    font-family: var(--font-data);
    font-size: 18px;
    font-weight: 700;
}

.search-page .pagination-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-page .pagination-info {
    color: var(--muted);
    font-size: 13px;
}

.search-page .pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-page .page-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink-soft);
}

.search-page .page-btn:hover:not([disabled]) {
    border-color: var(--brand);
    background: var(--surface-soft);
    color: var(--brand);
}

.search-page .page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* 列表容器（含防抓取水印） */
.search-page .results-list,
.watermark-container {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.watermark-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='80'%3E%3Ctext x='50%25' y='50%25' font-size='16' fill='rgba(0,82,255,0.18)' font-family='Microsoft YaHei' text-anchor='middle' dominant-baseline='middle' transform='rotate(-25 75 40)' font-weight='500'%3E星河企业查询--- 邮寄请发顺丰%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='60'%3E%3Ctext x='50%25' y='50%25' font-size='14' fill='rgba(255,106,0,0.15)' font-family='Microsoft YaHei' text-anchor='middle' dominant-baseline='middle' transform='rotate(15 60 30)' font-weight='500'%3E%3C/text%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='100'%3E%3Ctext x='50%25' y='50%25' font-size='18' fill='rgba(0,0,0,0.08)' font-family='Microsoft YaHei' text-anchor='middle' dominant-baseline='middle' transform='rotate(45 90 50)'%3E%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 1;
    opacity: 0.14;
    filter: grayscale(1);
}

.watermark-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 0, 0, 0.02) 2px, rgba(0, 0, 0, 0.02) 4px);
    pointer-events: none;
    z-index: 2;
    opacity: 0.09;
}

/* 单条结果 */
.search-page .company-item {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: stretch;
    gap: 14px;
    min-height: 96px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    cursor: pointer;
    transition: background 0.15s ease;
    -webkit-user-drag: none;
}

.search-page .company-item:last-child { border-bottom: 0; }

.search-page .company-item:hover { background: #fbfcff; }

.search-page .company-item .company-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.search-page .company-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.search-page .company-item .company-name {
    color: var(--brand-ink);
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 650;
    line-height: 1.4;
}

.search-page .company-name-text { display: inline; }

.search-page .company-region {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
}

.search-page .company-inline-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 28px;
}

.search-page .inline-tag {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: var(--muted);
}

.search-page .inline-tag small {
    font-size: 12px;
}

.search-page .inline-tag b {
    color: var(--ink-soft);
    font-family: var(--font-data);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.search-page .company-copy-btn {
    flex: 0 0 auto;
    align-self: center;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 17px;
}

.search-page .company-copy-btn:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
    color: var(--brand);
}

.search-page .highlight {
    padding: 0 2px;
    border-radius: 3px;
    background: #fff0e6;
    color: #c2451f;
    font-weight: 700;
}

/* 加载 / 空态 */
.search-loading-state,
.search-empty-state {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--ink-soft);
    font-size: 14px;
}

.search-loading-state i,
.search-empty-state i { color: var(--brand); font-size: 20px; }

.search-empty-state.is-error {
    border-color: #f0c9c5;
    background: var(--danger-soft);
    color: #a13d34;
}

.search-empty-state.is-error i { color: var(--danger); }

/* 返回顶部 */
.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 90;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--brand);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 10px 24px rgba(28, 71, 199, 0.28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.back-to-top:hover { background: var(--brand-strong); }

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ---- 搜索教程 ---------------------------------------------------------- */
.search-page .search-tutorial {
    padding: 40px 0 34px;
    border-top: 1px solid var(--line);
    background: var(--surface-soft);
}

.search-page .tutorial-container {
    width: min(100% - 32px, 1040px);
    margin: 0 auto;
    padding-inline: 0;
}

.search-page .tutorial-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.search-page .tutorial-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.search-page .tutorial-header h2 {
    margin: 6px 0 4px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1.3;
}

.search-page .tutorial-header p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.search-page .search-formula {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 14px 18px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--brand-ink);
    color: #fff;
}

.search-page .formula-label {
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    font-weight: 700;
}

.search-page .formula-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.78);
}

.search-page .formula-content strong {
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.search-page .formula-note {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
}

.search-page .tutorial-examples {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
}

.search-page .tutorial-example-row {
    display: grid;
    grid-template-columns: 36px minmax(170px, 1.3fr) minmax(170px, 1fr);
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--line);
}

.search-page .tutorial-example-row:last-child { border-bottom: 0; }

.search-page .example-number {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-data);
    font-size: 13px;
    font-weight: 700;
}

.search-page .example-purpose {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-page .example-purpose strong { color: var(--ink); font-size: 14px; }
.search-page .example-purpose span { color: var(--muted); font-size: 12px; }

.search-page .example-query {
    min-width: 0;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--brand);
}

.search-page .example-query code {
    overflow-wrap: anywhere;
    color: var(--ink);
    font-family: var(--font-data);
    font-size: 13px;
}

.search-page .tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.search-page .tutorial-footer p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.search-page .confirm-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.search-page .confirm-btn:hover { background: var(--brand-strong); }

/* ---- 详情页 ------------------------------------------------------------ */
.detail-page .main-container {
    width: min(100% - 32px, 1000px);
    margin: 28px auto 48px;
}

.detail-page .company-card,
.detail-page .detail-section {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.detail-page .company-card { padding: 28px; }

.detail-page .company-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.detail-page .company-name {
    margin: 0;
    color: var(--brand-ink);
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
}

.detail-page .company-status {
    flex: 0 0 auto;
    margin-top: 2px;
    padding: 5px 12px;
    border-radius: 6px;
}

.detail-page .status-active {
    border: 1px solid #b8ddc9;
    background: var(--success-soft);
    color: var(--success);
}

.detail-page .info-grid { border-top: 1px solid var(--line); }

.detail-page .info-item {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 14px 0;
    border-bottom: 1px solid var(--line);
}

.detail-page .info-label {
    flex: 0 0 132px;
    color: var(--muted);
    font-size: 14px;
}

.detail-page .info-value { color: var(--ink); font-size: 14px; }

.detail-page .tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 24px 0 12px;
    padding: 4px;
    border-bottom: 1px solid var(--line);
}

.detail-page .tab {
    position: relative;
    padding: 12px 14px;
    color: var(--ink-soft);
    font-weight: 600;
    cursor: pointer;
}

.detail-page .tab.active { color: var(--brand); }

.detail-page .tab.active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--brand);
}

.detail-page .detail-section { padding: 26px; }

.detail-page .section-title {
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
}

.detail-page .scope-card {
    margin-top: 8px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
}

.detail-page .scope-title {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}

.detail-page .scope-content { color: var(--ink); font-size: 14px; line-height: 1.75; }

.detail-page .detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.detail-page .detail-table th,
.detail-page .detail-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.detail-page .detail-table th { color: var(--muted); font-weight: 600; }

.detail-page .mobile-table-card {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    margin-bottom: 10px;
}

.detail-page .mobile-table-row { padding: 6px 0; }
.detail-page .mobile-table-label { color: var(--muted); font-size: 13px; }

.detail-page .key-info-card {
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 6px;
    background: var(--surface-soft);
}

.detail-page .key-info-title { color: var(--muted); font-size: 12px; }
.detail-page .key-info-content { margin-top: 4px; color: var(--ink); font-size: 14px; }

.detail-page .highlight,
.search-page .highlight {
    background: #fff0e6;
    color: #c2451f;
    font-weight: 700;
    border-radius: 3px;
    padding: 0 2px;
}

/* ---- 响应式 ------------------------------------------------------------ */
@media (max-width: 900px) {
    .search-page .search-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-page .search-filters .filters-label {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .search-page .search-filters .filter-reset {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-self: stretch;
    }
}

@media (max-width: 768px) {
    .header-container { width: min(100% - 24px, 1120px); }

    .search-page .hero { padding: 40px 14px 40px; }

    .search-page .hero-title { font-size: 32px; }

    .search-page .hero-subtitle { font-size: 15px; }

    .search-page .search-filters {
        grid-template-columns: minmax(0, 1fr);
        padding: 12px;
    }

    .search-page .search-filters .filters-label,
    .search-page .search-filters .filter-reset {
        grid-column: 1;
        grid-row: auto;
    }

    .search-page .search-filters .filter-reset { justify-self: stretch; }

    .result-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
    }

    .search-page .search-formula { grid-template-columns: 1fr; gap: 9px; }

    .search-page .formula-content { justify-content: flex-start; }

    .search-page .tutorial-example-row {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 9px 10px;
        padding: 13px 12px;
    }

    .search-page .example-number { grid-row: 1 / 3; align-self: start; }
    .search-page .example-query { grid-column: 2; }

    .search-page .tutorial-footer { flex-direction: column; align-items: stretch; }
    .search-page .confirm-btn { width: 100%; }

    .detail-page .main-container { width: min(100% - 24px, 1000px); margin: 18px auto 36px; }
    .detail-page .company-card, .detail-page .detail-section { padding: 18px; }
    .detail-page .company-name { font-size: 21px; }
    .detail-page .info-item { flex-direction: column; align-items: flex-start; gap: 4px; }
    .detail-page .info-label { flex: 0 0 auto; }
}

@media (max-width: 480px) {
    .search-page .brand-name { display: none; }
    .search-page .header-badge { font-size: 12px; padding: 5px 10px; }

    .search-page .hero-title { font-size: 27px; }

    .search-page .tab { width: 100%; }
    .search-page .tab-item { flex: 1; min-width: 0; }

    .search-page .search-box { min-height: 56px; }
    .search-page .search-input { padding: 12px 14px; font-size: 15px; }
    .search-page .search-btn { min-width: 58px; padding: 0 16px; }
    .search-page .search-btn span { display: none; }

    .search-page .company-inline-meta { gap: 0 18px; }
    .search-page .company-copy-btn { width: 40px; height: 40px; }

    .back-to-top {
        right: 12px;
        bottom: max(14px, env(safe-area-inset-bottom));
        width: 42px;
        height: 42px;
    }

    .detail-brand img { height: 28px; }
    .copy-detail-btn { min-width: 46px; width: 46px; padding: 0; }
    .copy-detail-btn span { display: none; }
}

/* ---- 无障碍：减少动效 -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}