:root {
    --color-navy: #12345a;
    --color-navy-dark: #0b223d;
    --color-blue: #2f6ea3;
    --color-blue-soft: #e8f1fa;
    --color-line: #d8e1ec;
    --color-bg: #f4f7fb;
    --color-panel: #ffffff;
    --color-text: #1f2d3d;
    --color-muted: #637083;
    --shadow-soft: 0 10px 28px rgba(18, 52, 90, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--color-text);
    background: var(--color-bg);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 64px;
    padding: 0 28px;
    color: #ffffff;
    background: var(--color-navy-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    font-weight: 700;
    white-space: nowrap;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: var(--color-navy-dark);
    background: #dbeafe;
    font-size: 13px;
    letter-spacing: 0;
}

.brand-text {
    font-size: 17px;
}

.main-nav {
    display: flex;
    align-items: stretch;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 64px;
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.78);
    border-bottom: 3px solid transparent;
    font-size: 14px;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border-bottom-color: #7db7e8;
}

.admin-link {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
}

.user-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.user-name {
    color: rgba(255, 255, 255, 0.86);
    font-size: 13px;
    white-space: nowrap;
}

.logout-form {
    margin: 0;
}

.logout-button {
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.88);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.auth-body {
    min-height: 100vh;
    background: var(--color-bg);
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    width: min(420px, 100%);
    padding: 28px;
    background: #ffffff;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.login-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.login-heading h1 {
    margin: 0 0 4px;
    font-size: 22px;
}

.login-heading p {
    margin: 0;
    color: var(--color-muted);
}

.login-panel form {
    display: grid;
    gap: 14px;
}

.login-button {
    padding: 11px 16px;
    color: #ffffff;
    background: var(--color-navy);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.form-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 6px;
}

.page-shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 34px 0 48px;
}

.page-heading {
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--color-line);
}

.compact-heading {
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--color-blue);
    font-size: 13px;
    font-weight: 700;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    color: var(--color-navy-dark);
    font-size: 30px;
    line-height: 1.25;
}

h2 {
    margin-bottom: 0;
    color: var(--color-navy-dark);
    font-size: 18px;
}

.heading-text {
    max-width: 720px;
    margin-bottom: 0;
    color: var(--color-muted);
    line-height: 1.7;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.metric-card,
.panel,
.placeholder-panel {
    background: var(--color-panel);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.metric-card {
    padding: 18px;
}

.metric-card p {
    margin-bottom: 12px;
    color: var(--color-muted);
    font-size: 14px;
}

.metric-card strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-navy-dark);
    font-size: 30px;
    line-height: 1;
}

.metric-card span,
.quick-item span,
.panel-heading span,
.placeholder-panel p {
    color: var(--color-muted);
    font-size: 13px;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
}

.panel {
    padding: 20px;
}

.wide-panel {
    grid-column: 1 / -1;
}

.panel-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-line);
}

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

.quick-item {
    padding: 14px;
    background: var(--color-blue-soft);
    border: 1px solid #cfe0f2;
    border-radius: 8px;
}

.quick-item strong {
    display: block;
    margin-bottom: 6px;
    color: var(--color-navy);
}

.clean-list,
.notice-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.clean-list li,
.notice-list li {
    padding: 11px 0;
    border-bottom: 1px solid var(--color-line);
    color: #34465b;
}

.clean-list li:last-child,
.notice-list li:last-child {
    border-bottom: 0;
}

.bond-reminder-panel {
    margin-bottom: 22px;
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.bond-reminder-header,
.bond-section-title,
.bond-reminder-stats {
    display: flex;
    align-items: center;
}

.bond-reminder-header {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-line);
}

.bond-reminder-header .eyebrow {
    margin-bottom: 6px;
}

.bond-reminder-stats {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.bond-reminder-stats span {
    padding: 6px 10px;
    color: #1f4f46;
    background: #e8f5f0;
    border: 1px solid #b9ddcf;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.bond-sections {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.6fr);
    gap: 18px;
}

.bond-section {
    min-width: 0;
}

.bond-section-title {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.bond-section-title h3 {
    margin: 0;
    color: var(--color-navy-dark);
    font-size: 16px;
}

.bond-section-title span {
    color: var(--color-muted);
    font-size: 13px;
}

.bond-event-list {
    display: grid;
    gap: 10px;
}

.bond-event-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: #fbfcfe;
    border: 1px solid var(--color-line);
    border-radius: 8px;
}

.bond-event-card strong {
    color: var(--color-navy-dark);
    font-size: 14px;
}

.bond-event-card p {
    margin: 0;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.6;
}

.bond-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    max-width: 220px;
    min-height: 24px;
    padding: 4px 8px;
    overflow: hidden;
    color: #ffffff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bond-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-line);
    border-radius: 8px;
}

.bond-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 13px;
}

.bond-table th,
.bond-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-line);
    text-align: left;
    vertical-align: top;
}

.bond-table th {
    color: #334155;
    background: #eef3f8;
    font-weight: 700;
    white-space: nowrap;
}

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

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

.bond-date {
    color: #b42318;
    font-weight: 700;
    white-space: nowrap;
}

.bond-empty-state {
    padding: 18px;
    color: var(--color-muted);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
}

.bond-empty-state.small {
    padding: 14px;
    font-size: 13px;
}

.placeholder-panel {
    padding: 24px;
}

.placeholder-panel div {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--color-navy-dark);
}

.placeholder-panel p {
    max-width: 680px;
    margin-bottom: 0;
    line-height: 1.7;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.tool-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 150px;
    padding: 22px;
    background: var(--color-panel);
    border: 1px solid var(--color-line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.tool-card p {
    margin: 10px 0 0;
    color: var(--color-muted);
    line-height: 1.7;
}

.tool-action {
    flex: 0 0 auto;
    padding: 10px 16px;
    color: #ffffff;
    background: var(--color-navy);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
}

.tool-action:hover {
    background: var(--color-blue);
}

.intern-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.intern-workspace.public-schedule {
    grid-template-columns: minmax(0, 1fr);
}

.intern-sidebar,
.schedule-panel,
.schedule-modal {
    background: #ffffff;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.intern-sidebar {
    position: sticky;
    top: 82px;
    display: grid;
    gap: 8px;
    padding: 16px;
}

.intern-sidebar-head,
.schedule-toolbar,
.schedule-actions,
.modal-head,
.modal-actions,
.schedule-detail-meta {
    display: flex;
    align-items: center;
}

.intern-sidebar-head {
    justify-content: space-between;
    margin-bottom: 8px;
}

.intern-sidebar-head h2,
.schedule-toolbar h2,
.modal-head h2 {
    margin: 0;
}

.intern-sidebar-head span,
.schedule-toolbar span,
.schedule-detail-meta {
    color: var(--color-muted);
    font-size: 13px;
}

.intern-list-item {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 11px 12px;
    color: var(--color-text);
    background: #f8fafc;
    border: 1px solid #dbe4ee;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.intern-list-item.active {
    background: var(--color-blue-soft);
    border-color: #8db9df;
}

.intern-list-item span,
.intern-empty {
    color: var(--color-muted);
    font-size: 13px;
}

.intern-side-actions {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--color-line);
}

.full-width {
    width: 100%;
}

.schedule-panel {
    min-width: 0;
    padding: 18px;
}

.schedule-toolbar {
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-line);
}

.schedule-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.icon-button,
.plain-button,
.primary-button,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.icon-button,
.plain-button {
    color: var(--color-navy-dark);
    background: #ffffff;
    border: 1px solid var(--color-line);
}

.icon-button {
    width: 36px;
    padding: 0;
}

.primary-button {
    color: #ffffff;
    background: var(--color-navy);
    border: 1px solid var(--color-navy);
}

.danger-button {
    color: #991b1b;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.schedule-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-line);
    border-radius: 8px;
}

.schedule-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
}

.schedule-table th,
.schedule-table td {
    border-bottom: 1px solid var(--color-line);
    border-right: 1px solid var(--color-line);
    vertical-align: top;
}

.schedule-table th {
    padding: 10px;
    color: #334155;
    background: #eef3f8;
    font-size: 13px;
    text-align: left;
}

.schedule-table thead th:not(.time-column) {
    text-align: center;
}

.schedule-table thead span {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-weight: 400;
}

.schedule-table td {
    height: 86px;
    padding: 7px;
    background: #fbfcfe;
}

.schedule-cell {
    cursor: crosshair;
}

.schedule-cell.selecting {
    background: #dbeafe;
    box-shadow: inset 0 0 0 2px #2f6ea3;
}

.schedule-table tr:last-child th,
.schedule-table tr:last-child td {
    border-bottom: 0;
}

.schedule-table th:last-child,
.schedule-table td:last-child {
    border-right: 0;
}

.time-column {
    width: 112px;
    white-space: nowrap;
}

.schedule-block {
    display: grid;
    gap: 4px;
    width: 100%;
    margin-bottom: 6px;
    padding: 8px;
    border: 1px solid #b9ddcf;
    border-radius: 6px;
    color: #173b34;
    background: #e8f5f0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.schedule-block.leave {
    color: #475569;
    background: #e5e7eb;
    border-color: #cbd5e1;
}

.schedule-block span,
.schedule-block small {
    font-size: 12px;
}

.schedule-block strong {
    overflow-wrap: anywhere;
    font-size: 13px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.36);
}

.modal-backdrop[hidden] {
    display: none;
}

.schedule-modal {
    width: min(620px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    overflow-y: auto;
    padding: 20px;
}

.modal-head {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-line);
}

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

.form-grid label {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.form-grid input,
.form-grid textarea {
    width: 100%;
    padding: 9px 10px;
    color: var(--color-text);
    border: 1px solid var(--color-line);
    border-radius: 6px;
    font: inherit;
    font-weight: 400;
}

.form-grid input:disabled,
.form-grid textarea:disabled {
    color: #64748b;
    background: #f8fafc;
}

.schedule-detail-meta {
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.modal-actions {
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-blue);
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 0 16px;
        padding: 12px 18px 0;
    }

    .main-nav {
        order: 3;
        flex-basis: 100%;
    }

    .nav-link {
        min-height: 48px;
    }

    .summary-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

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

    .bond-reminder-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .bond-reminder-stats {
        justify-content: flex-start;
    }

    .bond-sections {
        grid-template-columns: 1fr;
    }

    .tool-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .intern-workspace {
        grid-template-columns: 1fr;
    }

    .intern-sidebar {
        position: static;
    }

    .schedule-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .schedule-actions {
        justify-content: flex-start;
    }

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

@media (max-width: 560px) {
    .brand-text {
        font-size: 15px;
    }

    .admin-link {
        margin-left: auto;
    }

    .page-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 24px;
    }

    h1 {
        font-size: 24px;
    }
}
