:root {
    --bg: #f3f7fc;
    --bg-soft: #e9f1fa;
    --surface: #ffffff;
    --surface-2: #f5fbff;
    --line: #d8e4f1;
    --line-strong: #bfd1e3;
    --text: #10233e;
    --text-soft: #5a6d84;
    --primary: #0f4c81;
    --primary-hover: #0d3f6a;
    --accent: #0f766e;
    --accent-soft: #d8f0ec;
    --danger: #bf3a2b;
    --danger-hover: #9f3024;
    --success-bg: #e3f9f1;
    --success-text: #0f6a45;
    --error-bg: #fff0e7;
    --error-text: #ab4b16;
    --radius: 14px;
    --radius-lg: 18px;
    --shadow-1: 0 8px 22px rgba(15, 23, 42, 0.06);
    --shadow-2: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Avenir Next", "SF Pro SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(860px 300px at 10% -110px, #dff1ff 0%, transparent 62%),
        radial-gradient(720px 280px at 95% 0%, #e9f8f4 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 220px, var(--bg) 100%);
    line-height: 1.55;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 360px at 80% -120px, rgba(14, 75, 129, 0.09), transparent 58%),
        radial-gradient(640px 260px at 20% -120px, rgba(15, 118, 110, 0.05), transparent 62%);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(245, 250, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header::after {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg, #1d70b8 0%, #19a28d 50%, #e89f3d 100%);
    opacity: 0.75;
}

.header-inner {
    width: min(1120px, 92vw);
    margin: 0 auto;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #12345a;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-soft);
    padding: 0.36rem 0.72rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.main-nav a:hover {
    color: #123f6b;
    border-color: #c7d9ed;
    background: #f2f8ff;
}

.page-shell {
    width: min(1120px, 92vw);
    margin: 1.25rem auto 2rem;
    position: relative;
    z-index: 1;
}

.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 1rem;
    align-items: start;
}

.home-left {
    min-width: 0;
}

.home-ranking {
    position: sticky;
    top: 84px;
}

.ranking-scroll {
    max-height: 520px;
    overflow: auto;
    border-radius: 12px;
}

.table-compact th,
.table-compact td {
    padding: 0.5rem 0.5rem;
    font-size: 0.9rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid #d2deeb;
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.15rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 24px rgba(15, 58, 100, 0.07);
    animation: panelIn 0.24s ease;
}

.hero {
    border-color: #b8cee3;
    border-top-color: #1d70b8;
    background:
        linear-gradient(140deg, #ffffff 0%, #f6fbff 62%, #edf8f5 100%);
    box-shadow: 0 20px 42px rgba(15, 58, 100, 0.1);
}

.hero h2 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.4rem, 2.2vw, 1.78rem);
    letter-spacing: 0.01em;
}

.hero p {
    margin: 0;
    color: #4f657f;
    max-width: 820px;
}

.panel-accent-blue {
    border-top-color: #1d70b8;
}

.panel-accent-teal {
    border-top-color: #19967f;
}

.panel-accent-amber {
    border-top-color: #dd8f2c;
}

.panel h3 {
    margin: 0 0 0.55rem;
    font-size: 1.12rem;
}

.panel p {
    margin: 0.45rem 0;
}

.narrow {
    width: min(720px, 100%);
    margin-left: auto;
    margin-right: auto;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.badge-row {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-top: 0.8rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.26rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-blue {
    color: #155085;
    background: #e8f2fc;
    border-color: #bfd8f2;
}

.badge-teal {
    color: #0f6e5d;
    background: #e5f6f1;
    border-color: #bce8dc;
}

.badge-amber {
    color: #975f14;
    background: #fff3e5;
    border-color: #f4d7af;
}

.form-stack {
    display: grid;
    gap: 0.68rem;
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.95rem;
}

.inline-form {
    display: inline-block;
}

label {
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--text);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    padding: 0.62rem 0.74rem;
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder {
    color: #96a0af;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

textarea {
    resize: vertical;
    min-height: 110px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 10px;
    padding: 0.46rem 0.84rem;
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.13);
    border-color: #bad1e8;
}

.btn.primary {
    border-color: #0e4c80;
    background: linear-gradient(180deg, #1460a0 0%, #0f4c81 100%);
    color: #fff;
}

.btn.primary:hover {
    background: linear-gradient(180deg, #12558e 0%, #0d3f6a 100%);
    border-color: #0d3f6a;
}

.btn.danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.btn.danger:hover {
    border-color: var(--danger-hover);
    background: var(--danger-hover);
}

.btn.danger-light {
    border-color: #f4cfc9;
    background: #fff3f1;
    color: #a43d31;
}

.btn.disabled,
.btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: #fff;
    border: 1px solid #d6e3f0;
    border-radius: 12px;
    overflow: hidden;
}

.table th,
.table td {
    text-align: left;
    border-bottom: 1px solid #e6ecf3;
    padding: 0.62rem 0.56rem;
    vertical-align: middle;
}

.table th {
    background: linear-gradient(180deg, #f4f8fd 0%, #edf4fb 100%);
    color: #24405f;
    font-weight: 600;
}

.table tbody tr:hover {
    background: #f3f9ff;
}

.table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.table tbody tr:nth-child(even):hover {
    background: #f2f8ff;
}

.table td:first-child {
    font-weight: 700;
    color: #2a4d76;
}

.table td form {
    margin: 0;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.empty-cell,
.empty-state,
.tip-text {
    color: var(--text-soft);
}

.notice-list p {
    position: relative;
    margin: 0.55rem 0;
    padding-left: 0.85rem;
}

.notice-list p::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.42rem;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #19967f;
}

.flash-group {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.flash-message {
    border-radius: 10px;
    padding: 0.58rem 0.74rem;
    border: 1px solid transparent;
    font-size: 0.94rem;
}

.flash-message.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #b8e9c9;
}

.flash-message.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: #ffd6bf;
}

.site-footer {
    width: min(1120px, 92vw);
    margin: 0 auto 2rem;
    color: #5b6f86;
    text-align: center;
    font-size: 0.9rem;
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 920px) {
    .grid-cards,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .home-layout {
        grid-template-columns: 1fr;
    }

    .home-ranking {
        position: static;
    }

    .ranking-scroll {
        max-height: none;
    }
}

@media (max-width: 720px) {
    body {
        line-height: 1.5;
    }

    body::before {
        background:
            radial-gradient(460px 180px at 90% -70px, rgba(14, 75, 129, 0.08), transparent 62%),
            radial-gradient(360px 160px at 10% -60px, rgba(15, 118, 110, 0.05), transparent 64%);
    }

    .header-inner {
        min-height: auto;
        padding: 0.6rem 0 0.7rem;
        align-items: flex-start;
        flex-direction: column;
        gap: 0.55rem;
    }

    .main-nav {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.15rem;
        gap: 0.42rem;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.34rem 0.65rem;
        background: #ffffffd9;
        border-color: #d8e4f1;
    }

    .page-shell {
        width: min(1120px, 94vw);
        margin-top: 0.9rem;
    }

    .panel {
        border-radius: 14px;
        padding: 0.88rem 0.88rem;
    }

    .hero h2 {
        font-size: 1.28rem;
    }

    .panel h3 {
        font-size: 1.02rem;
    }

    .title-row {
        align-items: flex-start;
    }

    .action-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-top: 0.75rem;
    }

    .action-row .btn,
    .form-stack .btn,
    .inline-form .btn {
        width: 100%;
        min-height: 40px;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 0.75rem;
    }

    .form-inline input,
    .form-inline .btn,
    .inline-form {
        width: 100%;
    }

    input,
    select {
        min-height: 42px;
    }

    textarea {
        min-height: 120px;
    }

    .badge-row {
        gap: 0.4rem;
    }

    .badge {
        font-size: 0.76rem;
        padding: 0.22rem 0.58rem;
    }

    .table {
        border: 0;
        background: transparent;
    }

    .table thead {
        display: none;
    }

    .table,
    .table tbody,
    .table tr,
    .table td {
        display: block;
        width: 100%;
    }

    .table tbody {
        display: grid;
        gap: 0.68rem;
    }

    .table tbody tr {
        border: 1px solid #d6e3f0;
        border-radius: 12px;
        background: #ffffff;
        box-shadow: 0 6px 18px rgba(15, 58, 100, 0.08);
        overflow: hidden;
    }

    .table tbody tr:hover,
    .table tbody tr:nth-child(even),
    .table tbody tr:nth-child(even):hover {
        background: #ffffff;
    }

    .table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.85rem;
        text-align: right;
        padding: 0.56rem 0.74rem;
        border-bottom: 1px dashed #e2eaf4;
    }

    .table td::before {
        content: attr(data-label);
        text-align: left;
        font-weight: 600;
        color: #4c6380;
        flex: 0 0 auto;
    }

    .table td:first-child {
        color: #244f7d;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    .table td.empty-cell {
        display: block;
        text-align: left;
        border-bottom: 0;
    }

    .table td.empty-cell::before {
        content: "";
    }

    .table td .btn {
        width: auto;
        min-width: 84px;
    }

    .flash-message {
        font-size: 0.9rem;
        padding: 0.52rem 0.65rem;
    }
}
