:root {
    --bg: #f2f8f7;
    --card: #ffffff;
    --ink: #0f2d3a;
    --subtle: #4d6a75;
    --primary: #0b6b8a;
    --primary-strong: #08556d;
    --accent: #19a37a;
    --line: #d5e4e8;
    --warn: #f5aa3c;
    --success: #2c9b6f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: linear-gradient(150deg, #edf6f8 0%, #f9fcfd 100%);
}

.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.top-notice {
    background: #083c53;
    color: #d8eff7;
    font-size: 0.9rem;
    padding: 0.45rem 0;
}

.top-notice a {
    color: #7ce0b4;
    text-decoration: none;
    font-weight: 700;
}

.site-header {
    background: #ffffffde;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
}

.brand {
    color: var(--primary-strong);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: var(--subtle);
    text-decoration: none;
    font-weight: 600;
}

.page-main {
    padding: 1.5rem 0 2rem;
}

.hero-card,
.panel {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 10px 24px rgba(15, 45, 58, 0.04);
    margin-bottom: 1.2rem;
}

.subtitle,
.subtle {
    color: var(--subtle);
}

.beta-tag {
    display: inline-block;
    margin-left: 0.45rem;
    font-size: 0.78rem;
    background: #e6f6ff;
    border: 1px solid #b6dff4;
    color: #0a6280;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    vertical-align: middle;
}

.small-beta-note {
    margin-left: 0.45rem;
    font-size: 0.78rem;
    font-weight: 500;
    vertical-align: middle;
}

.stat-line {
    margin-top: 0.5rem;
    color: #285769;
    font-weight: 600;
}

.search-form {
    margin-top: 1rem;
}

.mode-switch {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.mode-option {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    color: var(--subtle);
    cursor: pointer;
}

.mode-option.active {
    border-color: var(--primary);
    color: var(--primary);
    background: #eef8fb;
}

.mode-option input {
    display: none;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 180px auto;
    gap: 0.6rem;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    background: #fff;
}

button {
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    padding: 0.65rem 1.1rem;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: var(--primary-strong);
}

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

.uni-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-decoration: none;
    color: var(--ink);
}

.uni-card:hover {
    border-color: #b7d9e2;
}

.uni-code {
    font-weight: 700;
    color: var(--primary-strong);
}

.uni-hint {
    color: var(--subtle);
    font-size: 0.9rem;
}

.uni-stat {
    color: #2f6274;
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

.layout-2col {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
}

.sidebar {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafdfe;
    padding: 0.7rem;
    max-height: 70vh;
    overflow: auto;
}

.dept-item {
    display: block;
    text-decoration: none;
    color: var(--ink);
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.5rem;
    margin-bottom: 0.35rem;
}

.dept-item.active {
    border-color: #bcd8e0;
    background: #edf7fa;
    color: var(--primary-strong);
}

.table-wrapper {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

th,
td {
    padding: 0.7rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

thead {
    background: #f4fafc;
}

.btn-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
}

.badge {
    background: #eaf8f2;
    color: #187754;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
}

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

.meta-item {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.meta-label {
    color: var(--subtle);
    font-size: 0.9rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}

.info-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fcfefe;
    padding: 0.8rem;
}

.register-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

.claim-mode-block {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fcfd;
    padding: 0.8rem;
    margin-bottom: 0.9rem;
}

.mode-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.6rem;
    margin-bottom: 0.45rem;
    background: #fff;
}

.mode-card input {
    width: auto;
    margin-top: 0.2rem;
}

.mode-card small {
    display: block;
    color: var(--subtle);
    margin-top: 0.2rem;
}

.realname-contact {
    border: 1px dashed #b8d9e2;
    background: #f2fbfe;
    border-radius: 12px;
    padding: 0.9rem;
    margin-bottom: 0.9rem;
}

.identity-note {
    border: 1px solid #b8d9e2;
    border-radius: 10px;
    background: #ffffff;
    padding: 0.6rem 0.7rem;
    color: #18495d;
    margin-bottom: 0.7rem;
    font-size: 0.92rem;
}

.full-row {
    grid-column: 1 / -1;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-weight: 600;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
    font-weight: 500;
}

.checkbox-row input {
    width: auto;
}

.supervisor-pick {
    margin-top: 1rem;
}

.bulk-claim {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f9fcfd;
    padding: 0.7rem;
    margin-bottom: 0.7rem;
    display: grid;
    gap: 0.65rem;
}

.bulk-claim select {
    margin-top: 0.3rem;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.5rem 0.6rem;
    background: #fff;
    font: inherit;
}

select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    background: #fff;
    font: inherit;
}

.bulk-actions {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.ghost-btn {
    background: #eaf2f5;
    color: #265161;
}

.ghost-btn:hover {
    background: #d9e8ee;
}

.warn-btn {
    background: #cc5b48;
}

.warn-btn:hover {
    background: #a74839;
}

.verified-star {
    color: #f1b500;
    margin-left: 0.3rem;
    font-size: 0.95rem;
    cursor: default;
}

.inline-form {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.contact-grid-form table {
    min-width: 620px;
}

.contact-grid-form th {
    width: 240px;
    white-space: nowrap;
}

.topic-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    background: #f7fcfd;
    font-weight: 500;
}

.topic-item input {
    width: auto;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 26, 36, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-card {
    width: min(460px, 92vw);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 18px 38px rgba(9, 33, 46, 0.2);
}

.ticket-id {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-strong);
    letter-spacing: 0.04em;
}

.pick-list {
    margin-top: 0.7rem;
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.5rem;
    background: #fbfefe;
}

.pick-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.45rem;
    margin-bottom: 0.35rem;
}

.pick-item:hover {
    border-color: #d1e5ea;
    background: #f4fbfd;
}

.pick-item input {
    width: auto;
    margin-top: 0.2rem;
}

.pick-item small {
    display: block;
    margin-top: 0.2rem;
    color: var(--subtle);
}

.flash-list {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.flash {
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    border: 1px solid transparent;
}

.flash-success {
    border-color: #bde9d7;
    background: #edfbf4;
    color: #206c50;
}

.flash-warning {
    border-color: #f4d8a7;
    background: #fff7ea;
    color: #8a5a07;
}

.empty {
    color: var(--subtle);
    padding: 0.8rem;
}

.site-footer {
    margin-top: 1rem;
    border-top: 1px solid var(--line);
    background: #f4fbfd;
}

.footer-inner {
    padding: 1rem 0 1.3rem;
    color: #315766;
    font-size: 0.95rem;
}

.footer-inner p {
    margin: 0.25rem 0;
}

@media (max-width: 900px) {
    .layout-2col {
        grid-template-columns: 1fr;
    }

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

    .register-form .form-grid,
    .meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .search-row {
        grid-template-columns: 1fr;
    }

    .university-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 0.7rem;
    }
}
