:root {
    --compliance-blue: #0868f7;
    --compliance-blue-strong: #0459dd;
    --compliance-ink: #121b2c;
    --compliance-muted: #71819a;
    --compliance-line: #dce8fa;
    --compliance-surface: #ffffff;
    --compliance-soft: #f4f8ff;
    --compliance-red: #ed5a5a;
    --compliance-amber: #e9952d;
    --compliance-green: #179b67;
    --compliance-shadow: 0 20px 55px rgba(27, 73, 139, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--compliance-ink);
    background:
        linear-gradient(rgba(8, 104, 247, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(8, 104, 247, 0.035) 1px, transparent 1px),
        #fbfdff;
    background-size: 48px 48px;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.compliance-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    padding: 0 clamp(20px, 5vw, 76px);
    border-bottom: 1px solid rgba(21, 48, 87, 0.08);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
}

.compliance-brand,
.nav-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.compliance-brand {
    gap: 10px;
    color: var(--compliance-ink);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.compliance-brand img {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    box-shadow: 0 6px 16px rgba(29, 69, 122, 0.12);
}

.nav-link {
    gap: 9px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid #d8e5f7;
    border-radius: 999px;
    color: #315278;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.nav-link::after {
    content: "\2192";
    color: var(--compliance-blue);
    font-size: 17px;
    line-height: 1;
}

.nav-link:hover {
    border-color: var(--compliance-blue);
    color: var(--compliance-blue);
    transform: translateX(2px);
}

.compliance-page {
    width: min(100% - 40px, 1320px);
    margin: 0 auto;
    padding: clamp(46px, 7vw, 86px) 0 88px;
}

.compliance-hero {
    max-width: 840px;
    margin: 0 0 34px;
}

.compliance-hero > span,
.panel-title > div > span,
.score-card > span {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 11px;
    border-radius: 999px;
    color: var(--compliance-blue);
    background: #eaf3ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.compliance-hero > span::before {
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--compliance-red);
    content: "";
}

.compliance-hero h1 {
    max-width: 780px;
    margin: 15px 0 15px;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: clamp(38px, 5vw, 68px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.07em;
}

.compliance-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--compliance-muted);
    font-size: 16px;
    line-height: 1.9;
}

.checker-shell {
    display: grid;
    grid-template-columns: minmax(360px, 0.96fr) minmax(440px, 1.14fr);
    grid-template-rows: auto auto;
    gap: 20px;
    align-items: stretch;
}

.input-panel,
.result-panel,
.rewrite-panel {
    border: 1px solid var(--compliance-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--compliance-shadow);
}

.input-panel {
    grid-row: 1 / span 2;
    padding: clamp(22px, 3vw, 32px);
}

.result-panel {
    display: flex;
    flex-direction: column;
    min-height: 414px;
    padding: clamp(20px, 2.6vw, 30px);
}

.rewrite-panel {
    display: flex;
    flex-direction: column;
    min-height: 330px;
    padding: clamp(20px, 2.6vw, 30px);
}

.panel-title,
.box-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-title {
    margin-bottom: 22px;
}

.panel-title h2 {
    margin: 8px 0 0;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 30px;
    line-height: 1.22;
    letter-spacing: -0.05em;
}

.panel-title button,
.box-heading button {
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #cfe0fb;
    border-radius: 999px;
    color: var(--compliance-blue);
    background: #f5f9ff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.panel-title button:hover,
.box-heading button:hover {
    border-color: var(--compliance-blue);
    background: #eaf3ff;
    transform: translateY(-1px);
}

label {
    display: block;
    margin: 18px 0 8px;
    color: #27415f;
    font-size: 13px;
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid #d6e4f5;
    border-radius: 15px;
    outline: none;
    color: var(--compliance-ink);
    background: #fbfdff;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input {
    min-height: 52px;
    padding: 0 15px;
    font-size: 15px;
}

textarea {
    min-height: 230px;
    padding: 15px;
    resize: vertical;
    font-size: 15px;
    line-height: 1.8;
}

input::placeholder,
textarea::placeholder {
    color: #9aa9bc;
}

input:focus,
textarea:focus {
    border-color: rgba(8, 104, 247, 0.72);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 104, 247, 0.1);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.action-row button {
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #d6e4f5;
    border-radius: 12px;
    color: #395470;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.action-row button:hover {
    border-color: var(--compliance-blue);
    color: var(--compliance-blue);
    transform: translateY(-1px);
}

.action-row .primary-action {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #167af8, #0868f7);
    box-shadow: 0 13px 24px rgba(8, 104, 247, 0.2);
}

.action-row .primary-action:hover {
    color: #fff;
    background: linear-gradient(135deg, #2b8aff, #0459dd);
}

.input-note {
    margin: 17px 0 0;
    padding-top: 15px;
    border-top: 1px solid #e7eef8;
    color: #91a0b3;
    font-size: 12px;
    line-height: 1.75;
}

.score-card {
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
    border: 1px solid #d9e7fb;
    border-radius: 18px;
    background: linear-gradient(135deg, #f5f9ff, #edf5ff);
}

.score-card::after {
    position: absolute;
    right: -26px;
    top: -34px;
    width: 124px;
    height: 124px;
    border: 24px solid rgba(8, 104, 247, 0.08);
    border-radius: 50%;
    content: "";
}

.score-card strong,
.score-card p {
    position: relative;
    z-index: 1;
}

.score-card strong {
    display: block;
    margin-top: 11px;
    color: var(--compliance-blue);
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.score-card p {
    max-width: 470px;
    margin: 10px 0 0;
    color: var(--compliance-muted);
    font-size: 13px;
    line-height: 1.7;
}

.score-card.is-low {
    border-color: rgba(23, 155, 103, 0.24);
    background: linear-gradient(135deg, #f4fcf8, #effaf5);
}

.score-card.is-low strong {
    color: var(--compliance-green);
}

.score-card.is-mid {
    border-color: rgba(233, 149, 45, 0.27);
    background: linear-gradient(135deg, #fffbf4, #fff6e7);
}

.score-card.is-mid strong {
    color: var(--compliance-amber);
}

.score-card.is-high {
    border-color: rgba(237, 90, 90, 0.27);
    background: linear-gradient(135deg, #fff7f7, #fff0f0);
}

.score-card.is-high strong {
    color: var(--compliance-red);
}

.result-grid {
    display: grid;
    grid-template-columns: minmax(200px, 0.78fr) minmax(260px, 1.22fr);
    gap: 14px;
    flex: 1;
    margin-top: 14px;
}

.result-box {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 16px;
    border: 1px solid #e0eaf8;
    border-radius: 17px;
    background: #fff;
}

.box-heading {
    align-items: center;
    margin-bottom: 12px;
}

.box-heading h3 {
    margin: 0;
    color: #1f3857;
    font-size: 15px;
    font-weight: 800;
}

.box-heading span {
    color: #91a0b3;
    font-size: 12px;
    font-weight: 700;
}

.hit-list {
    display: grid;
    gap: 8px;
    max-height: 164px;
    overflow: auto;
    padding-right: 3px;
}

.hit-list.empty,
.highlight-box.empty {
    color: #91a0b3;
}

.hit-card {
    padding: 10px;
    border: 1px solid #e4ecf8;
    border-radius: 12px;
    background: #fbfdff;
}

.hit-card strong {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 13px;
}

.hit-card em {
    font-style: normal;
    color: var(--compliance-red);
}

.hit-card p {
    margin: 0;
    color: var(--compliance-muted);
    font-size: 12px;
    line-height: 1.55;
}

.level-high {
    color: var(--compliance-red);
}

.level-mid {
    color: var(--compliance-amber);
}

.level-low {
    color: var(--compliance-blue);
}

.highlight-box {
    flex: 1;
    min-height: 152px;
    overflow: auto;
    padding: 13px;
    border-radius: 12px;
    color: #3d5878;
    background: #f8fbff;
    font-size: 13px;
    line-height: 1.85;
    white-space: pre-wrap;
    word-break: break-word;
}

.risk-mark {
    padding: 1px 4px;
    border-radius: 5px;
    font-weight: 800;
}

.risk-mark.level-high {
    background: rgba(237, 90, 90, 0.16);
}

.risk-mark.level-mid {
    background: rgba(233, 149, 45, 0.17);
}

.risk-mark.level-low {
    background: rgba(8, 104, 247, 0.12);
}

#rewriteOutput {
    flex: 1;
    min-height: 230px;
    background: #fbfdff;
}

@media (max-width: 960px) {
    .checker-shell {
        grid-template-columns: 1fr;
    }

    .input-panel {
        grid-row: auto;
    }

    .result-panel,
    .rewrite-panel {
        min-height: 0;
    }

    .result-grid {
        min-height: 310px;
    }
}

@media (max-width: 620px) {
    .compliance-nav {
        height: 64px;
        padding: 0 14px;
    }

    .compliance-brand span {
        display: none;
    }

    .nav-link {
        min-height: 36px;
        padding: 0 12px;
        font-size: 13px;
    }

    .compliance-page {
        width: min(100% - 24px, 1320px);
        padding: 34px 0 54px;
    }

    .compliance-hero {
        margin-bottom: 24px;
    }

    .compliance-hero h1 {
        font-size: 39px;
    }

    .compliance-hero p {
        font-size: 14px;
    }

    .input-panel,
    .result-panel,
    .rewrite-panel {
        border-radius: 19px;
    }

    .panel-title h2 {
        font-size: 26px;
    }

    .result-grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .result-box:first-child {
        min-height: 180px;
    }

    .highlight-box {
        min-height: 190px;
    }

    #rewriteOutput {
        min-height: 230px;
    }
}
