:root {
    --bg: #f7f8fa;
    --panel: #ffffff;
    --line: #dfe3e8;
    --text: #20242a;
    --muted: #667085;
    --accent: #1f6f5b;
    --accent-soft: #e7f2ee;
    --danger: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 Arial, "Microsoft YaHei", sans-serif;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 220px;
    background: #ffffff;
    border-right: 1px solid var(--line);
    padding: 20px 16px;
}

.brand {
    align-items: center;
    color: var(--text);
    display: flex;
    font-size: 20px;
    font-weight: 700;
    gap: 9px;
    margin-bottom: 22px;
}

.brand-mark {
    align-items: center;
    animation: ai-breathe 3.2s ease-in-out infinite;
    color: var(--accent);
    display: inline-flex;
    flex: 0 0 auto;
    height: 22px;
    justify-content: center;
    width: 22px;
}

.brand-mark svg {
    fill: none;
    height: 22px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.55;
    width: 22px;
}

.brand-mark circle {
    fill: currentColor;
    stroke: none;
}

@keyframes ai-breathe {
    0%, 100% {
        filter: drop-shadow(0 0 0 rgba(31, 111, 91, 0));
        opacity: .76;
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 2px rgba(31, 111, 91, .22));
        opacity: 1;
        transform: scale(1.04);
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-mark {
        animation: none;
    }
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar nav a {
    border-radius: 8px;
    color: var(--text);
    padding: 8px 11px;
    position: relative;
}

.sidebar nav a:hover {
    background: var(--accent-soft);
}

.sidebar nav a.is-active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.sidebar nav a.is-active::before {
    background: var(--accent);
    border-radius: 999px;
    content: "";
    inset: 8px auto 8px 0;
    position: absolute;
    width: 3px;
}

.main {
    margin-left: 220px;
    padding: 24px 28px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0;
    margin: 0 0 4px;
}

h1 {
    font-size: 25px;
    margin: 0;
}

h2 {
    font-size: 17px;
    margin: 18px 0 10px;
}

.actions,
.filters,
.form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bulk-bar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.bulk-bar button[disabled] {
    cursor: not-allowed;
    opacity: .45;
}

.danger-button {
    background: var(--danger);
    color: #ffffff;
}

/* Row actions read as one row of small, evenly sized controls, so an anchor and
   a submit button look the same rather than one being plain text. */
.pill {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 13px;
    justify-content: center;
    line-height: 1;
    padding: 6px 14px;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}

.pill:hover {
    background: #f1f5fb;
    border-color: var(--accent);
    color: var(--accent);
}

.pill-active {
    background: #fff4db;
    border-color: #e4c374;
    color: #946200;
}

.pill-active:hover {
    background: #ffeec4;
    border-color: #d9b45c;
    color: #7c5200;
}

.bulk-cell {
    text-align: center;
    width: 36px;
}

.row-actions {
    text-align: right;
    white-space: nowrap;
}

.row-actions a,
.row-actions button,
.row-actions form {
    align-items: center;
    display: inline-flex;
    margin-left: 8px;
    vertical-align: middle;
}

.button,
button {
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    justify-content: center;
    padding: 7px 12px;
}

.button.secondary {
    background: #e9ecef;
    color: var(--text);
}

.link {
    background: transparent;
    color: var(--accent);
    padding: 0;
}

.danger {
    color: var(--danger);
}

.metrics {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin-bottom: 18px;
}

.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px;
}

.metric span {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.metric strong {
    font-size: 24px;
}

.grid.two {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.detail-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 16px;
    max-width: 1180px;
    padding: 16px;
}

.detail-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

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

.detail-grid div {
    min-width: 0;
}

.detail-grid dt {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.detail-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
}

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

.preserve-text {
    line-height: 1.65;
    margin: 0;
    white-space: pre-wrap;
}

table {
    background: var(--panel);
    border: 1px solid var(--line);
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

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

th {
    background: #f0f3f5;
    color: #394150;
    font-weight: 600;
}

td small {
    color: var(--muted);
    display: block;
    margin-top: 4px;
}

.table-note {
    color: var(--muted);
    display: block;
    max-width: 360px;
}

.papers-table {
    table-layout: auto;
}

.papers-table .paper-title-cell {
    min-width: 320px;
    width: 32%;
    overflow-wrap: anywhere;
}

.papers-table .paper-title-cell strong,
.papers-table .paper-title-cell small {
    overflow-wrap: anywhere;
    word-break: break-word;
}

tr:last-child td {
    border-bottom: 0;
}

.drag-column {
    text-align: center;
    width: 34px;
}

.drag-handle {
    color: var(--muted);
    cursor: grab;
    display: inline-flex;
    font-size: 12px;
    justify-content: center;
    line-height: 1;
    min-width: 22px;
    padding: 5px 0;
    user-select: none;
}

tr.is-dragging {
    opacity: 0.55;
}

.sort-status {
    color: var(--muted);
    font-size: 12px;
    margin: 8px 0 0;
    min-height: 18px;
}

/* Targets list */
.targets-filters {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 8px;
}

.targets-filters input[type="search"] {
    min-width: 260px;
}

.targets-table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.targets-table {
    border: 0;
    border-radius: 0;
    table-layout: fixed;
}

.targets-table th,
.targets-table td {
    padding: 7px 10px;
    vertical-align: middle;
}

.targets-table th {
    background: #f6f8f9;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .02em;
}

.targets-table tbody tr {
    transition: background-color .15s ease;
}

.targets-table tbody tr:hover {
    background: #f8fbfa;
}

.targets-table .drag-column {
    padding-left: 6px;
    padding-right: 2px;
    width: 32px;
}

.targets-table .target-name {
    width: 34%;
}

.targets-table .type-column {
    width: 112px;
    white-space: nowrap;
}

.target-title {
    color: var(--text);
    display: block;
    font-weight: 700;
    line-height: 1.3;
}

.target-title:hover {
    color: var(--accent);
}

.targets-table .target-subject {
    color: #4b5563;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.targets-table .actions-column,
.targets-table .row-actions {
    width: 210px;
}

.targets-table .row-actions a,
.targets-table .row-actions form {
    margin-left: 6px;
}

.targets-table td small {
    margin-top: 2px;
}

.targets-table .drag-handle {
    font-size: 15px;
    letter-spacing: -4px;
}

.tag {
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--accent);
    display: inline-block;
    font-size: 12px;
    padding: 2px 7px;
}

.tag-success {
    background: #e7f6ec;
    color: #137333;
}

.tag-info {
    background: #e8f2ff;
    color: #175cd3;
}

.tag-primary {
    background: var(--accent-soft);
    color: var(--accent);
}

.tag-warning {
    background: #fff4db;
    color: #946200;
}

.tag-danger {
    background: #fdecec;
    color: var(--danger);
}

.tag-muted {
    background: #eef1f4;
    color: #596271;
}

.tag-neutral {
    background: #f2f4f7;
    color: #344054;
}

/* 状态标签：每个状态保持独立的颜色和边框，方便快速识别。 */
.status-idea { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.status-writing { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.status-revising { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.status-ready-to-submit { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.status-submitted { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.status-under-revision { background: #fefce8; color: #a16207; border: 1px solid #fde68a; }
.status-accepted { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.status-published { background: #dcfce7; color: #15803d; border: 1px solid #86efac; font-weight: 600; }
.status-rejected { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.status-paused { background: #f8fafc; color: #64748b; border: 1px solid #cbd5e1; }
.status-preparing { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.status-editor-check { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }
.status-under-review { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.status-major-revision { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.status-minor-revision { background: #fdf4ff; color: #a21caf; border: 1px solid #f5d0fe; }
.status-revision-submitted { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.status-withdrawn { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.status-planned { background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; }
.status-registered { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.status-to-submit { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.status-to-attend { background: #fdf4ff; color: #86198f; border: 1px solid #f5d0fe; }
.status-finished { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.status-canceled { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.empty {
    background: var(--panel);
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    padding: 14px;
}

.section-heading,
.notice-card-header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

/* A flex child refuses to shrink below its content width without this, so a
   long title would push the card -- and the page -- wider than the viewport. */
.section-heading > div,
.notice-card-header > div {
    min-width: 0;
}

.section-heading h2,
.notice-card h3 {
    margin: 0;
}

.notice-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.notice-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 16px;
}

.notice-card h3 {
    font-size: 16px;
    line-height: 1.45;
    margin-top: 7px;
    overflow-wrap: anywhere;
}

.notice-card time {
    color: var(--muted);
    flex: 0 0 auto;
    font-size: 12px;
}

.notice-times {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 14px 0 0;
}

.notice-times > div {
    background: var(--panel);
    border-radius: 7px;
    padding: 10px 12px;
}

.notice-times dt {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 3px;
}

.notice-times dd {
    font-weight: 650;
    margin: 0;
}

/* Crawled summaries end in a pasted source URL, which has no break point. */
.notice-summary {
    line-height: 1.7;
    margin: 14px 0 8px;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.notice-source {
    font-size: 13px;
    font-weight: 650;
    overflow-wrap: anywhere;
}

.personal-info {
    background: linear-gradient(135deg, #f4faf8 0%, #ffffff 42%);
    border: 1px solid #cfe4dc;
    border-radius: 12px;
    margin-top: 24px;
    max-width: 1180px;
    padding: 18px;
}

.personal-info-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.personal-info-header h2 {
    margin: 0;
}

.personal-info-badge {
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--accent);
    font-size: 12px;
    padding: 5px 10px;
    white-space: nowrap;
}

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

.info-card {
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--line);
    border-radius: 9px;
    min-width: 0;
    padding: 14px;
}

.info-card h3 {
    border-bottom: 1px solid #edf0f2;
    font-size: 15px;
    margin: 0 0 11px;
    padding-bottom: 8px;
}

.info-list {
    display: grid;
    gap: 9px;
    margin: 0;
}

.info-list div {
    display: grid;
    gap: 4px;
    grid-template-columns: 105px minmax(0, 1fr);
}

.info-list dt {
    color: var(--muted);
    font-size: 12px;
}

.info-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.info-list.compact {
    gap: 5px;
    margin-top: 8px;
}

.muted-inline,
.research-english,
.submission-note {
    color: var(--muted);
}

.research-title {
    font-size: 16px;
    font-weight: 600;
    margin: 4px 0 10px;
}

.research-english {
    line-height: 1.7;
    margin: 0;
}

.credential-row {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.credential-row span {
    color: var(--muted);
    font-size: 12px;
}

.credential-block {
    border-top: 1px solid #edf0f2;
    margin-top: 11px;
    padding-top: 10px;
}

.account-group {
    border-radius: 8px;
    padding: 10px;
}

.account-chinese {
    background: #f0f8f5;
    border: 1px solid #d7ebe3;
}

.account-english {
    background: #f2f6fc;
    border: 1px solid #dce6f4;
    margin-top: 10px;
}

.account-heading,
.account-link {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.account-heading strong {
    font-size: 14px;
}

.account-heading span,
.account-link span,
.account-hint {
    color: var(--muted);
    font-size: 12px;
}

.account-link {
    border-top: 1px solid rgba(31, 111, 91, .13);
    margin-top: 9px;
    padding-top: 8px;
}

.journal-card {
    grid-row: auto;
}

.journal-entry + .journal-entry {
    border-top: 1px solid #edf0f2;
    margin-top: 12px;
    padding-top: 12px;
}

.shared-credential {
    background: #f0f8f5;
    border: 1px solid #d7ebe3;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px;
}

.shared-credential-title {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.shared-credential-title span {
    color: var(--muted);
    font-size: 12px;
}

.journal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.journal-tags span {
    background: #ffffff;
    border: 1px solid #d7ebe3;
    border-radius: 999px;
    color: var(--accent);
    font-size: 12px;
    padding: 3px 7px;
}

.journal-entry h4 {
    font-size: 14px;
    margin: 0 0 5px;
}

.journal-entry p {
    font-size: 13px;
    line-height: 1.6;
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}

.long-link {
    display: block;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.submission-note {
    background: #f7f9fa;
    border-radius: 6px;
    padding: 6px 8px;
}

.info-wide {
    grid-template-columns: 105px minmax(0, 1fr) !important;
}

.filters {
    margin-bottom: 14px;
}

.filters input,
.filters select {
    max-width: 260px;
}

.form {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 11px;
    max-width: 980px;
    padding: 16px;
}

.form-subsection {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 11px;
    margin-top: 3px;
    padding-top: 4px;
}

.form-subsection h2 {
    margin-bottom: 0;
}

.form-note {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.file-section {
    margin-top: 18px;
    max-width: 1100px;
}

.upload-form {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(120px, 1fr)) auto;
    margin-bottom: 12px;
    padding: 12px;
}

.upload-form button {
    align-self: end;
    min-width: 80px;
}

label {
    color: #344054;
    display: grid;
    gap: 6px;
    font-size: 13px;
    width: 100%;
}

input,
select,
textarea {
    border: 1px solid #cfd6dd;
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    padding: 7px 9px;
    width: 100%;
}

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

.checkbox {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.checkbox input {
    width: auto;
}

.prompt-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    margin-bottom: 20px;
}

.prompt-card {
    background: linear-gradient(145deg, #ffffff 0%, #f7fbf9 100%);
    border: 1px solid #dce9e3;
    border-radius: 16px;
    cursor: pointer;
    min-height: 154px;
    overflow: hidden;
    padding: 22px 22px 20px 24px;
    position: relative;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.prompt-card::before {
    background: linear-gradient(180deg, #2d8a70, #8ac7b1);
    border-radius: 0 0 8px 8px;
    content: "";
    height: 42px;
    left: 0;
    position: absolute;
    top: 0;
    width: 4px;
}

.prompt-card::after {
    background: rgba(31, 111, 91, .06);
    border-radius: 50%;
    content: "";
    height: 92px;
    pointer-events: none;
    position: absolute;
    right: -36px;
    top: -40px;
    width: 92px;
}

.prompt-card:hover,
.prompt-card:focus-visible {
    border-color: #a9cfc0;
    box-shadow: 0 10px 24px rgba(31, 111, 91, .12);
    outline: none;
    transform: translateY(-2px);
}

.prompt-card h3 {
    color: #173f35;
    font-size: 17px;
    letter-spacing: .01em;
    line-height: 1.45;
    margin: 0 0 10px;
    position: relative;
    z-index: 1;
}

.prompt-note {
    color: #667d75;
    font-size: 13px;
    line-height: 1.65;
    margin: 0;
    position: relative;
    z-index: 1;
}

.modal-overlay {
    align-items: center;
    background: rgba(15, 23, 32, .45);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 100;
}

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

.modal {
    background: var(--panel);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    max-height: 88vh;
    max-width: 640px;
    overflow-y: auto;
    padding: 18px;
    width: 100%;
}

.modal-header {
    align-items: center;
    display: flex;
    gap: 10px;
}

.modal-header input {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    color: var(--muted);
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
    padding: 2px 6px;
}

.modal textarea#modal-text {
    font: 13px/1.6 "Consolas", "Microsoft YaHei", monospace;
    min-height: 260px;
}

.modal-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-status {
    color: var(--muted);
    flex: 1;
    font-size: 12px;
    margin: 0;
}

.prompt-add-hint {
    color: var(--muted);
    font-size: 12px;
    margin: -5px 0 0;
}

#prompt-add-result hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 4px 0 2px;
}

/* Competition detail */
.competition-detail-page {
    margin: 0 auto;
    max-width: 1260px;
}

.competition-hero {
    align-items: flex-start;
    background:
        radial-gradient(circle at 92% 12%, rgba(255, 255, 255, .24), transparent 24%),
        linear-gradient(135deg, #174f43 0%, #1f6f5b 58%, #2d806b 100%);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(20, 77, 64, .18);
    color: #fff;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    overflow: hidden;
    padding: 30px 32px 34px;
    position: relative;
}

.competition-hero::after {
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 50%;
    content: "";
    height: 220px;
    position: absolute;
    right: -80px;
    top: -105px;
    width: 220px;
}

.competition-hero-main {
    max-width: 880px;
    position: relative;
    z-index: 1;
}

.competition-back {
    color: rgba(255, 255, 255, .8);
    display: inline-flex;
    font-size: 13px;
    margin-bottom: 22px;
    text-decoration: none;
}

.competition-back:hover {
    color: #fff;
}

.competition-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.competition-hero-tags .tag {
    backdrop-filter: blur(6px);
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
}

.competition-hero h1 {
    color: #fff;
    font-size: clamp(27px, 3.2vw, 42px);
    letter-spacing: -.035em;
    line-height: 1.18;
    margin: 0;
}

.competition-hero-main > p {
    color: rgba(255, 255, 255, .78);
    line-height: 1.75;
    margin: 15px 0 0;
    max-width: 800px;
}

.competition-edit {
    background: #fff;
    color: var(--accent);
    flex: 0 0 auto;
    position: relative;
    text-decoration: none;
    z-index: 1;
}

.competition-edit:hover {
    background: #f2faf7;
}

.competition-key-facts {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(180px, .65fr));
    margin: -18px 22px 26px;
    position: relative;
    z-index: 2;
}

.competition-fact {
    background: rgba(255, 255, 255, .98);
    border: 1px solid rgba(223, 227, 232, .9);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(27, 43, 39, .09);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 92px;
    padding: 17px 19px;
}

.competition-fact > span,
.competition-fact > small {
    color: var(--muted);
    font-size: 12px;
}

.competition-fact strong {
    color: var(--text);
    font-size: 17px;
    line-height: 1.45;
    margin-top: 5px;
}

.competition-fact strong small {
    background: #eef1f0;
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    margin-left: 5px;
    padding: 3px 7px;
    white-space: nowrap;
}

.competition-fact-primary {
    border-color: #c7e4da;
}

.competition-fact-primary strong {
    color: #175c4b;
}

.competition-content-layout {
    align-items: start;
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 320px;
}

.competition-main-column,
.competition-side-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.competition-section,
.competition-side-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 7px 24px rgba(21, 39, 34, .045);
}

.competition-section {
    padding: 22px;
}

.competition-section-heading {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.competition-section-heading h2,
.competition-side-card h2 {
    color: var(--text);
    font-size: 19px;
    margin: 2px 0 0;
}

.competition-detail-page .eyebrow {
    color: #789087;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    margin: 0;
    text-transform: uppercase;
}

.notice-count {
    align-items: center;
    background: var(--accent-soft);
    border-radius: 999px;
    color: var(--accent);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    min-width: 28px;
    padding: 0 9px;
}

.notice-count-danger {
    background: #fde9e7;
    color: #a8473b;
}

.notice-count-warning {
    background: #fff3d8;
    color: #8b6414;
}

.competition-timeline {
    display: grid;
    gap: 10px;
    padding-left: 17px;
    position: relative;
}

.competition-timeline::before {
    background: #dbe7e2;
    bottom: 18px;
    content: "";
    left: 5px;
    position: absolute;
    top: 18px;
    width: 2px;
}

.competition-notice {
    background: #fbfcfc;
    border: 1px solid #e4e9e7;
    border-radius: 14px;
    position: relative;
}

.competition-notice[open] {
    background: #fff;
    border-color: #cfe2db;
    box-shadow: 0 8px 22px rgba(31, 111, 91, .07);
}

.competition-notice summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    list-style: none;
    min-height: 72px;
    padding: 14px 16px;
}

.competition-notice summary::-webkit-details-marker {
    display: none;
}

.timeline-marker {
    background: #a8bbb4;
    border: 3px solid #f7faf9;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #cbd8d3;
    flex: 0 0 auto;
    height: 12px;
    margin-left: -34px;
    width: 12px;
}

.competition-notice[open] .timeline-marker {
    background: var(--accent);
    box-shadow: 0 0 0 2px #bee0d5;
}

.notice-heading-copy {
    display: block;
    min-width: 0;
}

.notice-heading-copy strong {
    color: #263a34;
    display: block;
    font-size: 14px;
    line-height: 1.55;
    margin-top: 6px;
}

.notice-meta-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.notice-meta-row time {
    color: var(--muted);
    font-size: 11px;
}

.notice-chevron {
    border-bottom: 2px solid #81908b;
    border-right: 2px solid #81908b;
    flex: 0 0 auto;
    height: 8px;
    margin-left: auto;
    transform: rotate(45deg);
    transition: transform .2s ease;
    width: 8px;
}

.competition-notice[open] .notice-chevron {
    transform: rotate(225deg);
}

.competition-notice-body {
    border-top: 1px solid #e8ecea;
    margin: 0 16px 0 28px;
    padding: 16px 0 18px;
}

.competition-time-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin: 0 0 14px;
}

.competition-time-grid > div {
    background: #f3f8f6;
    border-radius: 10px;
    padding: 10px 12px;
}

.competition-time-grid dt {
    color: var(--muted);
    font-size: 11px;
    margin-bottom: 5px;
}

.competition-time-grid dd {
    color: #24483e;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0;
}

.competition-time-grid dd span {
    color: #91a19b;
    font-weight: 400;
    margin: 0 6px;
}

.competition-notice-summary,
.competition-side-card > p:not(.eyebrow) {
    color: #52635d;
    font-size: 13px;
    line-height: 1.75;
}

.competition-notice-summary {
    margin: 0 0 13px;
    white-space: pre-line;
}

.competition-brief-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 15px;
}

.competition-brief-item {
    background: linear-gradient(145deg, #f5faf8, #fbfdfc);
    border: 1px solid #e0ebe7;
    border-radius: 11px;
    min-width: 0;
    padding: 12px 13px;
}

.competition-brief-item > span {
    color: #568074;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

.competition-brief-item > p {
    color: #31463f;
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
    overflow-wrap: anywhere;
}

.competition-brief-item:nth-child(3n + 1) {
    grid-column: 1 / -1;
}

.source-link,
.secondary-link {
    align-items: center;
    color: var(--accent);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 5px;
    text-decoration: none;
}

.source-link:hover,
.secondary-link:hover {
    text-decoration: underline;
}

.competition-empty {
    background: #f7f9f8;
    border: 1px dashed #d7dfdc;
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
    padding: 22px;
    text-align: center;
}

.competition-advisory {
    align-items: center;
    background: #fff8e8;
    border: 1px solid #f1deae;
    border-radius: 13px;
    color: #73591e;
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 7px 12px;
    padding: 12px 15px;
}

.competition-advisory strong {
    color: #5e4714;
}

.competition-side-card {
    padding: 19px;
}

.competition-side-card > p:last-child {
    margin-bottom: 0;
}

.competition-source-card {
    background: linear-gradient(145deg, #f1f9f6, #fff);
    border-color: #cfe2db;
}

.source-link-block {
    background: var(--accent);
    border-radius: 9px;
    color: #fff;
    justify-content: center;
    margin-top: 10px;
    padding: 10px 12px;
    width: 100%;
}

.source-link-block:hover {
    color: #fff;
    text-decoration: none;
}

.secondary-link {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.competition-profile-list {
    margin: 12px 0 0;
}

.competition-profile-list > div {
    border-top: 1px solid #edf0ef;
    display: grid;
    gap: 12px;
    grid-template-columns: 76px minmax(0, 1fr);
    padding: 11px 0;
}

.competition-profile-list dt {
    color: var(--muted);
    font-size: 12px;
}

.competition-profile-list dd {
    color: #354740;
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.competition-detail-page > .file-section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 7px 24px rgba(21, 39, 34, .045);
    margin-top: 22px;
    max-width: none;
    overflow-x: auto;
    padding: 22px;
}

.competition-detail-page > .file-section h2 {
    font-size: 19px;
    margin-top: 0;
}

.competition-detail-page > .file-section .upload-form {
    background: #f8faf9;
}

@media (max-width: 1000px) {
    .competition-content-layout {
        grid-template-columns: 1fr;
    }

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

    .competition-source-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .competition-hero {
        border-radius: 18px;
        flex-direction: column;
        padding: 22px 20px 28px;
    }

    .competition-back {
        margin-bottom: 18px;
    }

    .competition-edit {
        width: 100%;
    }

    .competition-key-facts {
        grid-template-columns: 1fr;
        margin: -12px 10px 20px;
    }

    .competition-fact {
        min-height: 76px;
    }

    .competition-section {
        padding: 17px;
    }

    .competition-side-column {
        grid-template-columns: 1fr;
    }

    .competition-source-card {
        grid-column: auto;
    }

    .competition-notice summary {
        padding-right: 12px;
    }

    .competition-notice-body {
        margin-left: 16px;
    }

    .competition-time-grid {
        grid-template-columns: 1fr;
    }

    .competition-brief-grid {
        grid-template-columns: 1fr;
    }

    .competition-brief-item:nth-child(3n + 1) {
        grid-column: auto;
    }
}

@media (max-width: 860px) {
    .sidebar {
        position: static;
        width: auto;
    }

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

    .main {
        margin-left: 0;
        padding: 18px;
    }

    .page-header,
    .grid.two,
    .detail-grid,
    .form-row,
    .filters,
    .upload-form {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .personal-info-grid {
        grid-template-columns: 1fr;
    }

    .journal-card {
        grid-row: auto;
    }

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

    table {
        display: block;
        overflow-x: auto;
    }

    .targets-filters input[type="search"] {
        min-width: 0;
        width: 100%;
    }

    .targets-table-wrap {
        overflow-x: auto;
    }

    .targets-table {
        display: table;
        min-width: 680px;
    }
}

/* Compact competition detail layout */
.competition-detail-page {
    max-width: 1180px;
}

.competition-hero {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    color: var(--text);
    min-height: 0;
    padding: 18px 112px 18px 20px;
}

.competition-hero::after {
    display: none;
}

.competition-back,
.competition-back:visited {
    color: var(--accent);
    margin-bottom: 12px;
    padding: 4px 7px;
    margin-left: -7px;
    border-radius: 6px;
}

.competition-back:hover,
.competition-back:focus-visible {
    background: var(--accent-soft);
    color: #155444;
    outline: none;
}

.competition-hero-tags {
    gap: 5px;
    margin-bottom: 9px;
}

.competition-hero-tags .tag {
    backdrop-filter: none;
    background: #f2f5f4;
    border: 1px solid #dce4e1;
    color: #43524d;
}

.competition-detail-page .tag,
.competition-detail-page .tag-primary,
.competition-detail-page .tag-warning,
.competition-detail-page .tag-danger,
.competition-detail-page .tag-success,
.competition-detail-page .tag-info,
.competition-detail-page .tag-major,
.competition-detail-page .tag-neutral,
.competition-detail-page .tag-muted {
    background: #f2f4f3;
    border: 1px solid #dce3e0;
    color: #46534f;
}

.competition-hero h1 {
    color: var(--text);
    font-size: 24px;
    letter-spacing: -.015em;
    line-height: 1.35;
}

.competition-hero-main > p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 8px;
}

.competition-edit {
    background: #fff;
    border: 1px solid #b9c8c3;
    color: var(--accent);
    padding: 7px 12px;
    position: absolute;
    right: 18px;
    top: 18px;
}

.competition-key-facts {
    border: 1px solid var(--line);
    border-radius: 8px;
    gap: 0;
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(160px, .7fr));
    margin: 12px 0 16px;
    overflow: hidden;
}

.competition-fact,
.competition-fact-primary {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 72px;
    padding: 11px 14px;
}

.competition-fact + .competition-fact {
    border-left: 1px solid var(--line);
}

.competition-fact > span,
.competition-fact > small {
    font-size: 11px;
}

.competition-fact strong {
    font-size: 14px;
    line-height: 1.45;
    margin-top: 3px;
}

.competition-fact-primary {
    background: #f7f9f8;
}

.competition-fact-primary strong {
    color: var(--text);
}

.competition-content-layout {
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) 300px;
}

.competition-main-column,
.competition-side-column {
    gap: 12px;
}

.competition-section,
.competition-side-card {
    border-radius: 8px;
    box-shadow: none;
}

.competition-section {
    padding: 0;
}

.competition-section-heading {
    border-bottom: 1px solid var(--line);
    margin: 0;
    min-height: 48px;
    padding: 11px 14px;
}

.competition-section-heading h2,
.competition-side-card h2 {
    font-size: 15px;
    margin: 0;
}

.notice-count,
.notice-count-danger,
.notice-count-warning {
    background: #eef3f1;
    color: #52645e;
    font-size: 11px;
    height: 23px;
    min-width: 23px;
    padding: 0 7px;
}

.competition-timeline {
    gap: 0;
    padding: 0;
}

.competition-timeline::before,
.timeline-marker {
    display: none;
}

.competition-notice,
.competition-notice[open] {
    background: #fff;
    border: 0;
    border-bottom: 1px solid #e8ecea;
    border-radius: 0;
    box-shadow: none;
}

.competition-notice:last-child {
    border-bottom: 0;
}

.competition-notice summary {
    gap: 10px;
    min-height: 58px;
    padding: 10px 14px;
}

.notice-heading-copy strong {
    font-size: 13px;
    line-height: 1.45;
    margin-top: 4px;
}

.notice-meta-row {
    gap: 5px;
}

.notice-meta-row .tag {
    font-size: 10px;
    padding: 2px 6px;
}

.competition-notice-body {
    background: #fafcfb;
    border-top: 1px solid #edf0ef;
    margin: 0;
    padding: 12px 14px 14px;
}

.competition-time-grid {
    gap: 7px;
    margin-bottom: 10px;
}

.competition-time-grid > div {
    background: #f1f5f3;
    border-radius: 5px;
    padding: 8px 10px;
}

.competition-notice-summary,
.competition-side-card > p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.65;
}

.competition-empty {
    background: #fafbfb;
    border: 0;
    border-radius: 0 0 8px 8px;
    padding: 18px 14px;
}

.competition-advisory {
    background: #f7f9f8;
    border-color: var(--line);
    border-radius: 6px;
    color: var(--muted);
    padding: 9px 12px;
}

.competition-advisory strong {
    color: var(--text);
}

.competition-side-card {
    padding: 14px;
}

.competition-side-card h2 {
    border-bottom: 1px solid #edf0ef;
    margin: -2px 0 10px;
    padding-bottom: 9px;
}

.competition-source-card {
    background: #fff;
    border-color: var(--line);
}

.source-link-block {
    border-radius: 6px;
    margin-top: 8px;
    padding: 8px 10px;
}

.competition-profile-list {
    margin-top: 0;
}

.competition-profile-list > div {
    padding: 8px 0;
}

.competition-detail-page > .file-section {
    border-radius: 8px;
    box-shadow: none;
    margin-top: 14px;
    padding: 14px;
}

.competition-detail-page > .file-section h2 {
    font-size: 15px;
}

@media (max-width: 1000px) {
    .competition-content-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    .competition-hero {
        border-radius: 8px;
        padding: 15px;
    }

    .competition-hero h1 {
        font-size: 20px;
    }

    .competition-edit {
        display: inline-flex;
        margin-top: 12px;
        position: static;
        width: auto;
    }

    .competition-key-facts {
        grid-template-columns: 1fr;
        margin: 10px 0 14px;
    }

    .competition-fact + .competition-fact {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .competition-section {
        padding: 0;
    }

    .competition-side-column {
        grid-template-columns: 1fr;
    }
}
