* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #333; }

header { background: #fff; border-bottom: 1px solid #e5e5e5; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.header-inner { max-width: 1100px; margin: 0 auto; height: 60px; display: flex; align-items: center; padding: 0 20px; }
.logo { font-size: 22px; font-weight: bold; color: #1a73e8; margin-right: 40px; text-decoration: none; }
nav { flex: 1; }
nav a { color: #555; text-decoration: none; margin-right: 28px; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; transition: all .2s; }
nav a:hover, nav a.active { color: #1a73e8; border-bottom-color: #1a73e8; }
.user-area { font-size: 14px; color: #555; }
.user-area a { color: #999; margin-left: 12px; text-decoration: none; font-size: 13px; }
.user-area a:hover { color: #d4380d; }

main { max-width: 1100px; margin: 30px auto; padding: 0 20px; }
.card { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
h1 { font-size: 24px; margin-bottom: 12px; }
h2 { font-size: 20px; margin-bottom: 16px; }
h3 { font-size: 16px; margin-bottom: 12px; }
a { color: #1a73e8; }

/* ============ 登录页 ============ */
.login-page { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.2); width: 360px; }
.login-box .logo { text-align: center; margin: 0 0 8px; font-size: 32px; letter-spacing: 2px; }
.login-box .subtitle { text-align: center; color: #999; font-size: 14px; margin-bottom: 30px; }
.login-box input { width: 100%; padding: 12px 14px; font-size: 15px; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 16px; transition: border-color .2s; }
.login-box input:focus { outline: none; border-color: #1a73e8; }
.login-box button { width: 100%; padding: 12px; font-size: 16px; background: #1a73e8; color: #fff; border: none; border-radius: 6px; cursor: pointer; transition: background .2s; }
.login-box button:hover { background: #1557b0; }
.error { color: #d4380d; text-align: center; margin-bottom: 12px; font-size: 14px; }
.tip { text-align: center; color: #9ca3af; font-size: 12px; margin-top: 16px; }

/* ============ 题单卡片 ============ */
.set-list { display: flex; flex-direction: column; gap: 12px; }
.set-card { display: flex; align-items: center; padding: 20px 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; text-decoration: none; color: inherit; gap: 24px; transition: all .2s; }
.set-card:hover { border-color: #1a73e8; box-shadow: 0 4px 16px rgba(26,115,232,.1); transform: translateY(-1px); }
.set-info { flex: 1; min-width: 0; }
.set-title { font-size: 18px; font-weight: 600; color: #1a73e8; margin-bottom: 6px; }
.set-desc { color: #6b7280; font-size: 14px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-meta { color: #9ca3af; font-size: 13px; }
.set-progress { width: 220px; flex-shrink: 0; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: #9ca3af; margin-bottom: 6px; }
.progress-track { position: relative; height: 24px; background: #f3f4f6; border-radius: 12px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 12px; transition: width .4s; }
.progress-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 13px; font-weight: 600; color: #374151; }

/* ============ 表格 ============ */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
th { background: #f9fafb; color: #6b7280; font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: #fafbfc; }
.ac { color: #52c41a; font-weight: 600; font-size: 13px; }
.gray { color: #d1d5db; font-size: 13px; }

/* ============ 结果徽章 ============ */
.result-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; font-family: Consolas, monospace; }
.result-AC  { background: #d1fae5; color: #065f46; }
.result-WA  { background: #fee2e2; color: #991b1b; }
.result-TLE { background: #fef3c7; color: #92400e; }
.result-RE  { background: #fce7f3; color: #9d174d; }
.result-CE  { background: #e5e7eb; color: #374151; }

/* ============ 题目页 ============ */
.problem-page { height: calc(100vh - 130px); min-height: 600px; display: flex; flex-direction: column; }
.problem-layout { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; min-height: 0; }
.problem-left { overflow-y: auto; padding-right: 8px; }
.problem-left::-webkit-scrollbar { width: 6px; }
.problem-left::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.problem-right { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.lang-select { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f9fafb; border: 1px solid #e5e7eb; border-bottom: none; border-radius: 8px 8px 0 0; flex-shrink: 0; }
.lang-select label { font-size: 13px; color: #4b5563; font-weight: 500; }
.lang-select select { padding: 4px 10px; border: 1px solid #d1d5db; border-radius: 5px; font-size: 13px; background: #fff; cursor: pointer; }
#editor { flex: 1; min-height: 0; border: 1px solid #e5e7eb; border-radius: 0 0 8px 8px; }
.submit-bar { display: flex; justify-content: flex-end; margin-top: 12px; flex-shrink: 0; }
.btn-submit { padding: 10px 28px; background: #1a73e8; color: #fff; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: background .15s; }
.btn-submit:hover { background: #1557b0; }
.btn-submit:disabled { background: #9ca3af; cursor: not-allowed; }

.meta { color: #6b7280; font-size: 14px; margin-top: 8px; display: flex; gap: 24px; flex-wrap: wrap; }
.content { line-height: 1.8; white-space: pre-wrap; color: #374151; }
mark { background: #dbeafe; color: #1e40af; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.sample { margin-bottom: 16px; }
.sample-label { font-size: 13px; color: #9ca3af; margin-bottom: 8px; }
.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sample-title { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
pre { background: #f9fafb; padding: 12px; border-radius: 6px; white-space: pre-wrap; font-family: Consolas, "Courier New", monospace; font-size: 14px; border: 1px solid #e5e7eb; margin: 0; }
.breadcrumb { margin-bottom: 12px; font-size: 14px; color: #6b7280; flex-shrink: 0; }
.breadcrumb a { color: #1a73e8; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.ac-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; background: #d1fae5; color: #065f46; font-size: 13px; font-weight: 600; margin-left: 10px; }

/* ============ 提交详情 ============ */
.code-block { background: #1e293b; color: #e2e8f0; padding: 18px; border-radius: 8px; font-family: Consolas, monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-x: auto; max-height: 500px; overflow-y: auto; }
.error-block { background: #fef2f2; border: 1px solid #fecaca; padding: 14px; border-radius: 6px; font-family: Consolas, monospace; font-size: 13px; color: #991b1b; white-space: pre-wrap; }
.detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.detail-item .label { font-size: 12px; color: #9ca3af; margin-bottom: 4px; }
.detail-item .value { font-size: 16px; font-weight: 600; color: #374151; }

/* ============ 分页 ============ */
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span { display: inline-block; padding: 7px 14px; border-radius: 6px; font-size: 14px; text-decoration: none; color: #4b5563; border: 1px solid #e5e7eb; background: #fff; }
.pagination a:hover { border-color: #1a73e8; color: #1a73e8; }
.pagination .current { background: #1a73e8; color: #fff; border-color: #1a73e8; font-weight: 600; }
.pagination .disabled { color: #d1d5db; cursor: not-allowed; background: #f9fafb; }