:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #697386;
    --line: #dbe2ee;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #15803d;
    --danger: #b91c1c;
    --warning: #b45309;
    --shadow: 0 12px 28px rgba(31, 41, 55, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.lc-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    gap: 20px;
    min-height: 58px;
    padding: 0 22px;
    border-bottom: 1px solid #eeeeee;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

.lc-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
}

.lc-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #111827;
    color: #ffb02e;
    font-weight: 900;
}

.lc-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    color: #6b7280;
    font-weight: 600;
}

.lc-nav a {
    position: relative;
    padding: 19px 0;
}

.lc-nav a.active {
    color: #111827;
}

.lc-nav a.active::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 999px;
    background: #111827;
    content: "";
}

.lc-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-area {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.auth-button {
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #4b5563;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.auth-button.primary {
    border-color: #111827;
    background: #111827;
    color: #ffffff;
}

.auth-user {
    max-width: 150px;
    overflow: hidden;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.36);
}

.auth-dialog {
    width: min(100%, 420px);
    padding: 22px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.auth-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.auth-head strong {
    display: block;
    font-size: 20px;
}

.auth-head span {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.auth-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 20px;
    cursor: pointer;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 20px 0 14px;
    padding: 4px;
    border-radius: 999px;
    background: #f3f4f6;
}

.auth-tabs button {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.auth-tabs button.active {
    background: #ffffff;
    color: #111827;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.auth-message {
    margin: 0 0 12px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}

.auth-message:empty {
    display: none;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: #374151;
    font-weight: 800;
}

.auth-form input {
    width: 100%;
}

.auth-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.auth-required-state {
    display: grid;
    gap: 14px;
    justify-items: center;
}

.auth-required-state .button {
    margin: 0 4px;
}

.lc-search,
.problem-search,
.difficulty-filter {
    min-width: 0;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
}

.lc-search {
    width: 190px;
    padding: 9px 16px;
}

.lc-shell {
    display: grid;
    grid-template-columns: 260px minmax(560px, 1fr) 300px;
    gap: 26px;
    max-width: 1680px;
    margin: 0 auto;
    padding: 24px 28px 56px;
}

.home-shell {
    grid-template-columns: 260px minmax(560px, 1fr);
    max-width: 1380px;
}

.lc-sidebar {
    position: sticky;
    top: 82px;
    align-self: start;
    min-height: calc(100vh - 112px);
    border-right: 1px solid #eeeeee;
}

.lc-main {
    min-width: 0;
}

.topic-panel {
    padding: 22px 0 18px;
    border-bottom: 1px solid #eeeeee;
}

.topic-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #374151;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.topic-chip span {
    min-width: 28px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 12px;
}

.topic-chip.active {
    color: #111827;
}

.topic-chip.active span {
    background: #111827;
    color: #ffffff;
}

.problem-board {
    padding-top: 24px;
}

.problem-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 132px 42px auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.problem-search,
.difficulty-filter {
    height: 42px;
    padding: 0 16px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 20px;
    cursor: pointer;
}

.problem-count {
    color: #6b7280;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.problem-table-wrap {
    overflow: hidden;
    border-radius: 8px;
}

.problem-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.problem-table th {
    padding: 0 20px 6px;
    color: #9ca3af;
    font-size: 13px;
    text-align: left;
}

.problem-table td {
    padding: 16px 20px;
    background: #fafafa;
    color: #374151;
}

.problem-table tr:nth-child(even) td {
    background: #f5f5f5;
}

.problem-table td:first-child {
    border-radius: 8px 0 0 8px;
}

.problem-table td:last-child {
    border-radius: 0 8px 8px 0;
}

.problem-title-link {
    display: inline-flex;
    gap: 8px;
    color: #111827;
    font-weight: 800;
}

.problem-title-link span {
    color: #4b5563;
}

.table-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.table-tags button {
    min-height: 24px;
    padding: 0 9px;
    border: 0;
    border-radius: 999px;
    background: #eef2f7;
    color: #64748b;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.acceptance {
    color: #6b7280;
    white-space: nowrap;
}

.difficulty {
    font-weight: 800;
}

.difficulty.easy {
    color: #16a34a;
}

.difficulty.medium {
    color: #f59e0b;
}

.difficulty.hard {
    color: #ef4444;
}

.lc-right {
    display: grid;
    gap: 18px;
    align-content: start;
    padding-top: 36px;
}

.submissions-shell {
    grid-template-columns: 260px minmax(620px, 1fr) 360px;
}

.submission-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 22px 0 18px;
    border-bottom: 1px solid #eeeeee;
}

.submission-filter {
    display: grid;
    grid-template-columns: minmax(180px, 260px) auto auto;
    align-items: center;
    gap: 10px;
}

.submission-filter input {
    min-width: 0;
    height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
}

.submission-filter .button {
    min-height: 42px;
    border-radius: 999px;
}

.submission-tools .status-line {
    grid-column: 1 / -1;
    margin: 0;
}

.submissions-board {
    padding-top: 24px;
}

.submissions-table td {
    vertical-align: middle;
}

.submissions-table td:nth-child(1),
.submissions-table td:nth-child(4),
.submissions-table td:nth-child(5),
.submissions-table td:nth-child(6) {
    white-space: nowrap;
}

.submission-problem-link {
    font-weight: 800;
}

.submission-detail-button {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
}

.submissions-right {
    padding-top: 22px;
}

.submission-detail-card {
    position: sticky;
    top: 82px;
    max-height: calc(100vh - 112px);
    overflow: auto;
    padding: 20px;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.submission-detail-card .detail-empty {
    margin-top: 16px;
}

.submission-detail-card .detail-list {
    margin-top: 16px;
}

.submission-detail-card .case-item {
    border: 0;
    background: #f7f7f8;
}

.submission-detail-card .case-item pre {
    background: #ffffff;
    color: #4b5563;
}

.daily-card,
.right-card {
    padding: 20px;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.daily-head,
.right-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.daily-head span {
    padding: 4px 9px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 12px;
    font-weight: 800;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin: 18px 0;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.calendar-grid span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
}

.calendar-grid span.active {
    border-radius: 999px;
    background: #22c55e;
    color: #ffffff;
    font-weight: 800;
}

.daily-link {
    display: block;
    overflow: hidden;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff7ed;
    color: #ea580c;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.right-card-head button {
    border: 0;
    background: transparent;
    color: #6b7280;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.popular-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.company-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #4b5563;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.company-chip span {
    color: #f59e0b;
}

.company-chip.active {
    background: #fff7ed;
    color: #ea580c;
}

.empty-inline {
    color: #9ca3af;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.stats-grid div {
    padding: 14px;
    border-radius: 8px;
    background: #f9fafb;
}

.stats-grid span {
    display: block;
    color: #111827;
    font-size: 24px;
    font-weight: 900;
}

.stats-grid small {
    color: #6b7280;
    font-weight: 700;
}

.problem-work-body {
    height: 100vh;
    overflow: hidden;
    background: #f5f5f5;
}

.work-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.work-left,
.work-center,
.work-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.work-center {
    justify-content: center;
}

.work-right {
    justify-content: flex-end;
}

.work-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #111827;
    color: #ffb02e;
    font-weight: 900;
}

.work-link,
.work-current,
.work-separator {
    color: #4b5563;
    font-weight: 700;
}

.work-current {
    color: #111827;
}

.work-tool,
.work-submit {
    min-height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.work-tool {
    background: #f3f4f6;
    color: #4b5563;
}

.work-submit {
    background: #dcfce7;
    color: #16a34a;
}

.work-submit:hover {
    background: #bbf7d0;
}

.work-submit:disabled,
.work-tool:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.work-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
    gap: 10px;
    height: calc(100vh - 44px);
    padding: 10px;
}

.work-pane {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
}

.pane-tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 46px;
    padding: 0 18px;
    border-bottom: 1px solid #f0f0f0;
    color: #9ca3af;
    font-weight: 800;
}

.pane-tabs span.active {
    color: #111827;
}

.statement-scroll {
    height: calc(100% - 46px);
    overflow-y: auto;
    padding: 30px 26px 56px;
}

.statement-scroll h1 {
    margin-bottom: 18px;
    color: #111827;
    font-size: 28px;
}

.statement-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.problem-difficulty {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 13px;
    font-weight: 900;
}

.problem-difficulty.easy {
    background: #dcfce7;
    color: #16a34a;
}

.problem-difficulty.medium {
    background: #fef3c7;
    color: #f59e0b;
}

.problem-difficulty.hard {
    background: #fee2e2;
    color: #ef4444;
}

.statement-description {
    white-space: pre-wrap;
    color: #24292f;
    font-size: 16px;
    line-height: 1.9;
}

.statement-section {
    margin-top: 34px;
}

.statement-section h2 {
    margin-bottom: 14px;
    font-size: 18px;
}

.leetcode-examples {
    display: grid;
    gap: 18px;
}

.leetcode-example h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.leetcode-example pre {
    overflow-x: auto;
    margin: 0;
    padding: 16px 18px;
    border-left: 3px solid #d1d5db;
    border-radius: 6px;
    background: #f7f7f8;
    color: #4b5563;
    font-family: Consolas, "Courier New", monospace;
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.meta-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.meta-strip div {
    padding: 14px;
    border-radius: 8px;
    background: #f7f7f8;
}

.meta-strip span {
    display: block;
    margin-bottom: 8px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 800;
}

.editor-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto 8px auto;
}

.editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid #f0f0f0;
}

.editor-head strong {
    color: #111827;
}

.editor-head strong span {
    color: #16a34a;
}

.editor-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 700;
}

.leetcode-editor {
    min-height: 0;
    height: 100%;
    border: 0;
    border-radius: 0;
    resize: none;
    background: #ffffff;
    color: #1f2937;
    font-size: 15px;
    line-height: 1.7;
}

.leetcode-editor:focus {
    outline: none;
    border-color: transparent;
}

.editor-status {
    min-height: 38px;
    padding: 9px 16px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    color: #6b7280;
    font-size: 14px;
}

.result-tabs {
    display: flex;
    min-height: 38px;
    padding: 0 16px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: #ffffff;
    color: #6b7280;
    font-weight: 800;
}

.result-tabs span {
    display: inline-flex;
    align-items: center;
}

.result-tabs span.active {
    color: #16a34a;
}

.leetcode-result {
    position: relative;
    height: 260px;
    min-height: 96px;
    overflow: auto;
    margin: 0;
    padding: 16px;
    border: 0;
    border-radius: 0;
    background: #ffffff;
}

.result-resize-handle {
    position: relative;
    z-index: 3;
    height: 8px;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    background: #ffffff;
    cursor: ns-resize;
    touch-action: none;
}

.result-resize-handle::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 18px;
    border: 1px solid #dbe2ee;
    border-radius: 999px;
    background: #ffffff;
    color: #64748b;
    font-size: 13px;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
    transform: translate(-50%, -50%);
    opacity: 0;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    content: "↕";
}

.result-resize-handle:hover,
.result-resize-handle:active {
    background: #f8fafc;
}

.result-resize-handle:hover::before,
.result-resize-handle:active::before,
.resizing-result-panel .result-resize-handle::before {
    opacity: 1;
}

.resizing-result-panel {
    cursor: ns-resize;
    user-select: none;
}

.leetcode-result-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.leetcode-result-head span:last-child {
    color: #6b7280;
}

.leetcode-case-list {
    display: grid;
    gap: 18px;
}

.leetcode-case-result {
    padding: 0;
    background: transparent;
}

.leetcode-case-result h3 {
    margin: 0 0 10px;
    font-size: 17px;
}

.leetcode-case-result pre {
    overflow-x: auto;
    margin: 8px 0 0;
    color: #4b5563;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.ai-analysis-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.ai-analysis-button {
    min-height: 34px;
    padding: 0 13px;
    border: 0;
    border-radius: 999px;
    background: #eef4ff;
    color: #2563eb;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.ai-analysis-button:hover {
    background: #dbeafe;
}

.ai-analysis-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.ai-analysis-result {
    margin-top: 14px;
    padding: 16px 18px;
    border-left: 3px solid #93c5fd;
    border-radius: 6px;
    background: #f8fafc;
    color: #1f2937;
}

.ai-analysis-result.error {
    border-left-color: #fca5a5;
    background: #fff1f2;
    color: #991b1b;
}

.leetcode-result .ai-analysis-result pre {
    overflow-x: auto;
    margin: 0;
    background: transparent;
    color: inherit;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 40px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.subtitle {
    margin-left: 12px;
    color: var(--muted);
    font-size: 14px;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--muted);
    font-weight: 600;
}

.nav a:hover,
.nav a.active {
    background: #e8f0ff;
    color: var(--primary);
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.toolbar,
.problem-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: 30px;
}

h2 {
    margin-bottom: 0;
    font-size: 19px;
}

.toolbar p,
.problem-header p {
    margin-bottom: 0;
    color: var(--muted);
}

.api-panel,
.content-panel {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.api-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.api-form label,
.label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

input {
    min-width: 280px;
    padding: 10px 12px;
}

textarea {
    padding: 14px;
}

input:focus,
textarea:focus {
    outline: 3px solid rgba(37, 99, 235, 0.18);
    border-color: var(--primary);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid #c9d4e5;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.button.primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.button.primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
    color: #ffffff;
}

.button.secondary {
    background: #eef4ff;
    color: var(--primary);
}

.button.ghost {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.status-line {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.status-line.ok {
    color: var(--success);
}

.status-line.error {
    color: var(--danger);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.muted {
    color: var(--muted);
}

.problem-list {
    display: grid;
    gap: 12px;
}

.problem-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.problem-card:hover {
    border-color: #9bb7ee;
}

.problem-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.problem-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
}

.tag-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.category-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
    color: var(--text);
}

.category-card:hover,
.category-card.active {
    border-color: var(--primary);
    background: #eef4ff;
}

.category-card span {
    font-weight: 800;
}

.category-card strong {
    color: var(--muted);
    font-size: 14px;
}

.tag-button {
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.tag-button:hover,
.tag-button.active {
    border-color: var(--primary);
    background: #e8f0ff;
    color: var(--primary);
}

.problem-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

a.tag-pill:hover {
    background: #e8f0ff;
    color: var(--primary);
}

.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.badge.easy {
    background: #dcfce7;
    color: var(--success);
}

.badge.medium {
    background: #fef3c7;
    color: var(--warning);
}

.badge.hard {
    background: #fee2e2;
    color: var(--danger);
}

.status-badge.accepted {
    background: #dcfce7;
    color: var(--success);
}

.status-badge.failed {
    background: #fee2e2;
    color: var(--danger);
}

.status-badge.running {
    background: #e0f2fe;
    color: #0369a1;
}

.empty-state,
.detail-empty {
    padding: 26px;
    border: 1px dashed #b9c4d6;
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--primary);
    font-weight: 700;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.95fr);
    gap: 18px;
    align-items: start;
}

.submissions-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
}

.description {
    white-space: pre-wrap;
    line-height: 1.7;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.info-grid > div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

code {
    font-family: Consolas, "Courier New", monospace;
}

.subsection-title {
    margin: 22px 0 12px;
}

.case-list {
    display: grid;
    gap: 10px;
}

.example-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.example-title {
    font-weight: 800;
}

.example-row {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.example-row span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.example-row code {
    display: block;
    overflow-x: auto;
    padding: 9px 10px;
    border-radius: 6px;
    background: #eef4ff;
    color: #1e3a8a;
    line-height: 1.5;
}

.case-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.case-item pre,
.result-panel pre {
    overflow: auto;
    margin: 8px 0 0;
    padding: 10px;
    border-radius: 6px;
    background: #111827;
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1.5;
}

.code-editor {
    min-height: 430px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.55;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.result-panel {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.leetcode-result .leetcode-case-result pre {
    padding: 16px 18px;
    border-left: 3px solid #d1d5db;
    border-radius: 6px;
    background: #f7f7f8;
    color: #4b5563;
    font-family: Consolas, "Courier New", monospace;
    font-size: 15px;
    line-height: 1.8;
}

.hidden {
    display: none;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 740px;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    font-size: 14px;
}

.data-table th {
    color: var(--muted);
    font-weight: 800;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.detail-row span:first-child {
    color: var(--muted);
}

.admin-create-page {
    display: grid;
    grid-template-columns: minmax(360px, 0.78fr) minmax(520px, 1.22fr);
    gap: 22px;
    width: min(1420px, calc(100% - 48px));
    margin: 24px auto 48px;
    align-items: start;
}

.admin-panel {
    padding: 22px;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.admin-form-panel {
    position: sticky;
    top: 82px;
}

.admin-problem-form {
    display: grid;
    gap: 16px;
}

.admin-problem-form label {
    display: grid;
    gap: 8px;
    color: #374151;
    font-weight: 800;
}

.admin-problem-form input,
.admin-problem-form textarea,
.admin-problem-form select {
    width: 100%;
    min-width: 0;
    border: 0;
    border-radius: 8px;
    background: #f3f4f6;
    color: #111827;
    font: inherit;
}

.admin-problem-form input,
.admin-problem-form select {
    min-height: 48px;
    padding: 0 16px;
}

.admin-problem-form textarea {
    resize: vertical;
    min-height: 92px;
    padding: 14px 16px;
    line-height: 1.7;
}

.admin-problem-form input:focus,
.admin-problem-form textarea:focus,
.admin-problem-form select:focus {
    outline: 3px solid rgba(37, 99, 235, 0.16);
    background: #ffffff;
}

.admin-preview-empty {
    padding: 42px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    text-align: center;
}

.admin-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.admin-preview-head h1 {
    margin-bottom: 12px;
}

.admin-preview-section {
    margin-top: 28px;
}

.admin-preview-section h2 {
    margin-bottom: 12px;
}

.admin-code-preview,
.admin-case-item pre,
.admin-json-details pre {
    overflow-x: auto;
    margin: 0;
    padding: 16px 18px;
    border-left: 3px solid #d1d5db;
    border-radius: 6px;
    background: #f7f7f8;
    color: #4b5563;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
}

.admin-case-list {
    display: grid;
    gap: 16px;
}

.admin-case-item {
    display: grid;
    gap: 10px;
}

.admin-case-item h3 {
    margin: 0;
    font-size: 16px;
}

.admin-case-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-case-grid strong {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 13px;
}

.admin-json-details {
    margin-top: 28px;
}

.admin-json-details summary {
    margin-bottom: 12px;
    color: #2563eb;
    font-weight: 800;
    cursor: pointer;
}

.admin-saved-banner {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    background: #dcfce7;
    color: #166534;
    font-weight: 800;
}

.admin-saved-banner a {
    color: #14532d;
    text-decoration: underline;
}

@media (max-width: 860px) {
    .lc-topbar {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .lc-nav {
        overflow-x: auto;
        gap: 18px;
    }

    .lc-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .lc-shell {
        grid-template-columns: 1fr;
        padding: 0 16px 36px;
    }

    .lc-sidebar,
    .lc-right {
        display: none;
    }

    .submissions-body .lc-actions,
    .submissions-right {
        display: flex;
    }

    .submissions-body .lc-actions {
        align-items: center;
    }

    .submissions-shell {
        grid-template-columns: 1fr;
    }

    .submission-tools {
        grid-template-columns: 1fr;
    }

    .submission-filter {
        grid-template-columns: 1fr auto auto;
    }

    .submissions-right {
        padding-top: 0;
    }

    .submission-detail-card {
        position: static;
        width: 100%;
        max-height: none;
    }

    .problem-tools {
        grid-template-columns: 1fr;
    }

    .problem-count {
        text-align: left;
    }

    .problem-table {
        min-width: 720px;
    }

    .problem-table-wrap {
        overflow-x: auto;
    }

    .problem-work-body {
        height: auto;
        overflow: auto;
    }

    .work-topbar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 14px;
    }

    .work-center,
    .work-right {
        justify-content: flex-start;
    }

    .work-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .work-pane {
        overflow: visible;
    }

    .statement-scroll {
        height: auto;
        overflow: visible;
    }

    .editor-pane {
        min-height: 680px;
    }

    .meta-strip {
        grid-template-columns: 1fr;
    }

    .topbar,
    .toolbar,
    .problem-header {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar {
        padding: 14px 18px;
    }

    .nav {
        width: 100%;
    }

    .nav a {
        flex: 1;
        text-align: center;
    }

    .page {
        width: min(100% - 22px, 1180px);
        margin-top: 18px;
    }

    .split-layout,
    .submissions-layout,
    .info-grid {
        grid-template-columns: 1fr;
    }

    input {
        min-width: 0;
    }

    .problem-card {
        grid-template-columns: 1fr;
    }

    .code-editor {
        min-height: 320px;
    }

    .example-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .admin-create-page {
        grid-template-columns: 1fr;
        width: min(100% - 22px, 1180px);
        margin-top: 18px;
    }

    .admin-form-panel {
        position: static;
    }

    .admin-case-grid {
        grid-template-columns: 1fr;
    }
}
