.root-polish-shell,
.root-result-page,
.root-legal-list {
    --root-primary: var(--theme-primary);
    --root-primary-rgb: var(--theme-primary-rgb);
    --root-danger: var(--theme-danger);
    --root-warning: var(--theme-warning);
    --root-text: var(--theme-text);
    --root-muted: var(--theme-muted);
    --root-copy: var(--theme-copy);
    --root-soft: var(--theme-surface-soft);
    --root-border: var(--theme-border);
    --root-shadow: var(--theme-shadow-soft);
    --root-shadow-hover: var(--theme-shadow-hover);
}

.root-polish-shell {
    padding-bottom: 2rem;
}

.root-polish-shell > hr {
    border-top: 1px solid var(--theme-border);
}

.root-public-section {
    margin-top: 1.75rem;
}

.root-panel-card,
.root-action-card,
.root-table-card,
.root-empty-state,
.root-result-card {
    background: var(--theme-surface);
    border: 1px solid var(--root-border) !important;
    border-radius: 0.5rem;
    box-shadow: var(--root-shadow);
}

.root-panel-card,
.root-action-card,
.root-table-card {
    overflow: hidden;
}

.root-action-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.root-action-card:hover {
    border-color: rgba(var(--root-primary-rgb), 0.22) !important;
    box-shadow: var(--root-shadow-hover);
    transform: translateY(-2px);
}

.root-public-hero {
    position: relative;
    overflow: hidden;
    background: var(--theme-surface);
    border: 1px solid var(--root-border);
    border-left: 5px solid var(--root-primary);
    border-radius: 0.5rem;
    box-shadow: var(--root-shadow);
    margin-top: 1.75rem;
    padding: 1.5rem;
}

.root-hero-kicker {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: rgba(var(--root-primary-rgb), 0.1);
    color: var(--root-primary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    padding: 0.25rem 0.65rem;
}

.root-hero-title {
    color: var(--root-text);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.45rem;
}

.root-hero-copy {
    color: var(--root-copy);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.root-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(50, 50, 93, 0.08);
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.9rem;
}

.root-brand-mark img {
    display: block;
    max-height: 34px;
    max-width: 160px;
}

.root-hero-actions,
.root-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.root-hero-actions {
    justify-content: flex-end;
}

.root-metric-grid,
.root-entry-grid {
    display: grid;
    gap: 0.85rem;
}

.root-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.root-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.root-metric-card,
.root-entry-card {
    min-width: 0;
    background: var(--root-soft);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.root-entry-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    color: var(--root-copy);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.root-entry-card:hover {
    background: var(--theme-surface-raised);
    border-color: rgba(var(--root-primary-rgb), 0.18);
    color: var(--root-primary);
    text-decoration: none;
}

.root-icon,
.root-empty-icon,
.root-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(var(--root-primary-rgb), 0.1);
    color: var(--root-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.root-result-icon {
    width: 52px;
    height: 52px;
    font-size: 1.35rem;
    margin: 0 auto 1rem;
}

.root-metric-label,
.root-entry-label {
    display: block;
    color: var(--root-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    margin-bottom: 0.3rem;
}

.root-metric-value,
.root-entry-title {
    display: block;
    color: var(--root-text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}

.root-entry-copy {
    display: block;
    color: var(--root-copy);
    font-size: 0.84rem;
    line-height: 1.55;
    margin-top: 0.25rem;
}

.root-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--root-soft);
    border-bottom: 1px solid var(--theme-border);
    padding: 1rem 1.25rem;
}

.root-panel-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.root-panel-heading h2 {
    color: var(--root-text);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.root-panel-subtitle {
    color: var(--root-muted);
    display: block;
    font-size: 0.8rem;
    line-height: 1.45;
    margin-top: 0.25rem;
}

.root-record-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(var(--root-primary-rgb), 0.1);
    color: var(--root-primary);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 3.2rem;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
}

.root-table-card .table,
.root-polish-table {
    font-size: 0.86rem;
    margin-bottom: 0;
}

.root-table-card .table thead th,
.root-polish-table thead th {
    background: var(--theme-surface-raised);
    border-bottom: 1px solid var(--theme-border);
    color: var(--root-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    padding: 0.85rem 1rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.root-table-card .table tbody td,
.root-polish-table tbody td {
    border-top: 1px solid var(--theme-border);
    color: var(--root-copy);
    padding: 0.95rem 1rem;
    vertical-align: middle;
}

.root-table-card .table tbody tr:hover td,
.root-polish-table tbody tr:hover td {
    background: var(--theme-surface-raised);
}

.root-code-chip {
    display: inline-block;
    max-width: 100%;
    line-height: 1.5;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-all;
}

.root-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem;
    padding: 1.5rem;
    color: var(--root-muted);
    text-align: center;
}

.root-empty-state p {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0;
}

.root-state-section .shape-container {
    min-height: 72vh;
}

.root-state-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72vh;
    padding: 2rem 1rem;
    text-align: center;
}

.root-state-code {
    color: #fff;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
}

.root-state-title {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.root-state-copy {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0 auto 1.25rem;
    max-width: 520px;
}

.root-result-page {
    min-height: 100vh;
    min-height: 100svh;
    background: var(--root-soft);
    display: flex;
    align-items: center;
    padding: 2rem 1rem;
}

.root-result-page,
.root-result-page * {
    box-sizing: border-box;
}

.root-result-card {
    margin: 0 auto;
    max-width: 640px;
    padding: 2rem;
    text-align: center;
    width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
}

.root-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--root-soft);
    color: var(--root-primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.root-result-title {
    color: var(--root-text);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 1rem 0 0.5rem;
}

.root-result-copy {
    color: var(--root-copy);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.root-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.root-result-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--root-primary);
    border: 1px solid var(--root-primary);
    border-radius: 0.45rem;
    color: var(--theme-on-primary);
    font-weight: 700;
    min-height: 44px;
    padding: 0.65em 1.15em;
    text-decoration: none;
}

.root-result-button:hover {
    background: var(--root-primary);
    color: var(--theme-on-primary);
    box-shadow: 0 0 0 3px rgba(var(--root-primary-rgb), 0.18);
    text-decoration: none;
}

.root-result-page a:focus-visible {
    outline: 2px solid var(--root-primary);
    outline-offset: 3px;
}

.root-password-display {
    min-width: 0;
    width: 100%;
    background: var(--theme-surface-raised);
    border: 1px dashed rgba(var(--root-primary-rgb), 0.28);
    border-radius: 0.5rem;
    color: var(--root-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    padding: 1rem;
    word-break: break-all;
}

.root-password-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.5rem;
    margin: 1rem 0;
}

.root-password-action {
    min-width: 68px;
    border: 1px solid rgba(var(--root-primary-rgb), 0.24);
    border-radius: 0.45rem;
    background: var(--theme-surface);
    color: var(--root-primary);
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 480px) {
    .root-password-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .root-password-display {
        grid-column: 1 / -1;
    }
}

.root-result-footer {
    color: var(--root-muted);
    font-size: 0.8rem;
    margin-top: 1.25rem;
}

.root-result-footer a {
    color: var(--root-primary);
    font-weight: 700;
}

.root-legal-list {
    display: block; /* 改为 block 配合滚动 */
    list-style: none;
    margin: 0;
    padding: 0;
    padding-right: 0.4rem; /* 为滚动条留出空间 */
    max-height: 280px; /* 限制最大高度 */
    overflow-y: auto; /* 开启纵向滚动 */
    /* 优化 Firefox 滚动条 */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* 优化 Chrome/Safari/Edge 滚动条外观 */
.root-legal-list::-webkit-scrollbar {
    width: 4px;
}
.root-legal-list::-webkit-scrollbar-track {
    background: transparent;
}
.root-legal-list::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.root-legal-list li {
    margin-bottom: 0.2rem;
    position: relative;
    background: var(--root-soft);
    border: 1px solid var(--theme-border);
    border-radius: 0.5rem;
    color: var(--root-copy);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 0.5rem 0.9rem 0.5rem 2.65rem;
}

.root-legal-list li::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1.12rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--root-primary);
}

.root-legal-list li.is-danger {
    background: var(--theme-danger-soft);
    border-color: rgba(245, 54, 92, 0.2);
    color: var(--theme-danger);
}

.root-legal-list li.is-danger::before {
    background: var(--root-danger);
}

.root-legal-list li.is-warning {
    background: var(--theme-warning-soft);
    border-color: rgba(242, 184, 75, 0.22);
    color: var(--theme-warning);
}

.root-legal-list li.is-warning::before {
    background: var(--root-warning);
}

.root-legal-list code {
    color: var(--root-primary);
    font-weight: 700;
}

.root-terms-card {
    margin-bottom: 1rem;
}

.root-terms-card .card-body {
    padding: 1.25rem;
}

.root-shop-shell .oix-shop-card {
    border: 1px solid var(--root-border);
    border-radius: 0.5rem;
    box-shadow: var(--root-shadow);
    margin-bottom: 0;
    padding: 1rem;
}

.root-shop-shell .oix-shop-card:hover {
    border-color: rgba(var(--root-primary-rgb), 0.22);
    box-shadow: var(--root-shadow-hover);
}

.root-shop-shell .oix-category-badge {
    border-radius: 999px;
    font-weight: 700;
}

.root-shop-shell .oix-btn {
    align-items: center;
    border-radius: 0.45rem;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 38px;
    text-decoration: none;
}

.root-footer-cta {
    background: var(--theme-surface);
    border-top: 1px solid var(--theme-border);
}

.root-footer-title {
    color: var(--root-text, #32325d);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.root-footer-copy {
    color: var(--root-copy, #525f7f);
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    .root-metric-grid,
    .root-entry-grid {
        grid-template-columns: 1fr;
    }

    .root-hero-actions {
        justify-content: flex-start;
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .root-polish-shell {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .root-public-hero,
    .root-result-card {
        padding: 1.25rem;
    }

    .root-hero-title,
    .root-result-title {
        font-size: 1.35rem;
    }

    .root-state-code {
        font-size: 3rem;
    }

    .root-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .root-action-card:hover,
    .root-shop-shell .oix-shop-card:hover {
        transform: none;
    }

    .root-empty-state {
        align-items: center;
        flex-direction: column;
    }

    .root-hero-actions .btn,
    .root-footer-actions .btn {
        width: 100%;
    }

    .root-legal-list li {
        line-height: 1.34;
        padding: 0.34rem 0.66rem 0.34rem 1.55rem;
        word-wrap: break-word;
        word-break: break-word;
    }

    .root-legal-list li::before {
        left: 0.58rem;
        top: 0.68rem;
        width: 0.4rem;
        height: 0.4rem;
    }
}
