:root {
    --primary: #24292e;
    --accent: #0366d6;
    --bg: #f6f8fa;
    --card-bg: #ffffff;
    --text: #24292e;
    --border: #e1e4e8;
    --success: #28a745;
    --error: #d73a49;
}

body {
    font-family: -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.problem-list,
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.problem-item,
.history-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: 0.2s;
}

.problem-item:hover,
.history-item:hover {
    background: #f1f8ff;
}

.problem-item.active {
    background: #e1f0ff;
    border-left: 4px solid var(--accent);
}

.main-content {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
}

textarea {
    width: 100%;
    height: 300px;
    font-family: monospace;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-sizing: border-box;
}

button {
    background: var(--success);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

button:disabled {
    background: #959da5;
}

.hidden {
    display: none !important;
}

.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    color: white;
    background: #666;
}

.status-Accepted {
    background: var(--success);
}

.status-Wrong {
    background: var(--error);
}

/* 导航栏 */
#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
}

.nav-brand {
    font-size: 1.2em;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
}

.nav-links a:hover {
    opacity: 1;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8em;
}

/* Hero */
.hero {
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.hero-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.hero-actions .btn {
    padding: 12px 30px;
    font-size: 1.1em;
    text-decoration: none;
}

/* Auth Card */
.auth-card {
    max-width: 400px;
    margin: 60px auto;
    padding: 30px;
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 20px;
}

.auth-card input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-sizing: border-box;
}

.auth-card .btn {
    width: 100%;
    margin-top: 5px;
}

.btn-github {
    background: #24292e;
}

.divider {
    text-align: center;
    margin: 15px 0;
    color: #999;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.auth-link {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9em;
}

/* List Layout */
.list-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    height: 100%;
}

.problem-list-panel,
.history-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.problem-list-panel h2,
.history-panel h2 {
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.problem-list,
.history-list {
    overflow-y: auto;
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
}

.problem-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.problem-item:hover {
    background: #f1f8ff;
}

.pid {
    font-weight: bold;
    color: var(--accent);
    min-width: 50px;
}

.difficulty {
    color: var(--warning);
    font-size: 0.8em;
    margin-left: auto;
}

.history-item {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
}

/* Detail Layout */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.desc-content {
    white-space: pre-wrap;
    margin: 15px 0;
    line-height: 1.8;
}

.tag {
    display: inline-block;
    background: #f1f8ff;
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    border: 1px solid #c8e1ff;
}

.samples {
    background: #f6f8fa;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    border: 1px solid var(--border);
}

.test-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.test-row .meta {
    font-size: 0.8em;
    color: #666;
    margin-left: auto;
}

/* Utilities */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error {
    color: var(--error);
    padding: 15px;
    background: #ffeef0;
    border-radius: 4px;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {

    .list-layout,
    .detail-layout {
        grid-template-columns: 1fr;
    }
}