/* ===== common ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: ui-sans-serif, system-ui, 'Noto Sans CJK SC', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; background: #f5f5f5; color: #333; font-size: 16px; }
a { color: #0066cc; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== list page ===== */
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
h1 { margin-bottom: 16px; font-size: 22px; }
h2 { margin-bottom: 12px; font-size: 18px; }
table { width: 100%; border-collapse: collapse; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 13px; }
th { background: #fafafa; font-weight: 600; position: sticky; top: 0; z-index: 1; box-shadow: 0 1px 0 #ddd; }
tr:hover { background: #f0f7ff; }
.done { color: #999; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.stats { margin-bottom: 16px; font-size: 13px; color: #666; }

/* ===== shared: split layout ===== */
.split-container { display: flex; height: 100vh; }
.divider { width: 5px; background: #ccc; cursor: col-resize; flex-shrink: 0; }
.divider:hover { background: #999; }

/* ===== shared: info & history ===== */
.line1 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.line1 .name { font-size: 22px; font-weight: 700; }
.line1 .position { font-size: 16px; color: #555; }
.line1 .case-id { font-size: 14px; color: #999; }
.line2 { font-size: 16px; color: #666; margin-bottom: 12px; display: flex; gap: 24px; }

.section-label { font-size: 14px; font-weight: 600; color: #999; margin: 12px 0 4px; }
.extra-text { font-family: "SF Mono", Consolas, monospace; font-size: 15px; background: #f8f8f8; padding: 10px; border-radius: 4px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; margin-bottom: 6px; }
.ai-fields { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.ai-field { padding: 6px 12px; border-radius: 6px; font-size: 14px; line-height: 1.5; display: flex; gap: 4px; }
.ai-key { font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.ai-key::after { content: "："; }
.ai-val { word-break: break-word; }
.ai-bad { background: #fee2e2; color: #991b1b; }
.ai-neutral { background: #f3f4f6; color: #6b7280; }
.ai-good { background: #dcfce7; color: #166534; }

.history-list { list-style: none; }
.history-list li { padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 16px; line-height: 1.5; }
.history-list li:last-child { border-bottom: none; }
.hist-from { font-weight: 600; }
.hist-badge { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 14px; vertical-align: 1px; }
.hist-pass { background: #efe; color: #363; }
.hist-fail { background: #fee; color: #c33; }
.hist-pending { background: #eee; color: #666; }
.hist-type { background: #e8f0fe; color: #1a73e8; }
.hist-date { color: #999; font-size: 14px; }
.hist-msg { color: #555; }

/* ===== shared: review form ===== */
.radio-group { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.radio-group label { font-size: 14px; padding: 4px 10px; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; user-select: none; }
.radio-group input[type="radio"] { display: none; }
.radio-group input[type="radio"]:checked + span { color: #1a73e8; font-weight: 600; }
.radio-group label:has(input:checked) { border-color: #1a73e8; background: #e8f0fe; }
textarea { width: 100%; height: 60px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 15px; font-family: inherit; resize: none; }
.btn-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.btn { padding: 6px 16px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; cursor: pointer; background: #fff; text-decoration: none; color: #333; display: inline-block; text-align: center; }
.btn:hover { background: #f0f0f0; }
.btn-primary { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.btn-primary:hover { background: #1557b0; }
.btn-disabled { opacity: .4; pointer-events: none; }
.error-msg { color: #c33; font-size: 14px; margin-top: 4px; display: none; }

/* ===== detail page ===== */
body.detail-page { height: 100vh; overflow: hidden; }
.left-panel { flex: 1; min-width: 200px; background: #e8e8e8; display: flex; flex-direction: column; overflow: hidden; }
.left-panel iframe { flex: 1; border: none; width: 100%; height: 100%; }
.left-panel .text-view { flex: 1; overflow-y: auto; padding: 16px; font-family: "SF Mono", Consolas, monospace; font-size: 15px; white-space: pre-wrap; word-break: break-word; background: #fff; }
.right-panel-detail { flex: 1; min-width: 300px; display: flex; flex-direction: column; overflow: hidden; }
.right-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 8px; }
.right-fixed { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid #ddd; background: #fff; }
.line1 .back { display: inline-flex; align-items: center; color: #999; }
.line1 .back:hover { color: #333; }
.line1 .back svg { width: 22px; height: 22px; }

/* ===== new page ===== */
body.new-page { background: #f5f5f5; }
.new-container { max-width: 700px; margin: 0 auto; padding: 32px 20px; }
.new-container h1 { font-size: 22px; margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group > label { display: block; font-size: 14px; font-weight: 600; color: #555; margin-bottom: 6px; }
.new-container .radio-group { margin-bottom: 0; }
.source-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.source-row input[type="text"] { padding: 4px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; font-family: inherit; width: 140px; }
.source-row input[type="text"]:focus { border-color: #1a73e8; outline: none; }
input[type="file"] { font-size: 14px; }
.new-container textarea { height: 120px; }

/* ===== session page ===== */
body.session-page { height: 100vh; overflow: hidden; }
.case-list { width: 208px; flex-shrink: 0; overflow-y: auto; background: #fff; border-right: 1px solid #ddd; }
.case-list a { display: block; padding: 6px 12px; font-size: 14px; border-bottom: 1px solid #f0f0f0; color: #333; line-height: 1.4; overflow: hidden; }
.name-row { display: flex; align-items: center; gap: 4px; overflow: hidden; }
.last-type { font-size: 12px; padding: 0 4px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 14px; line-height: 14px; flex-shrink: 0; max-width: 60%; background: #eee; color: #666; }
.last-type.t-talk { background: #e8f0fe; color: #1a73e8; }
.last-type.t-interview { background: #e6f4ea; color: #1e7e34; }
.last-type.t-question { background: #fef7e0; color: #b45309; }
.last-type.t-reject { background: #fee; color: #c33; }
.last-type.t-other { background: #f3e8ff; color: #7c3aed; }
.last-type.t-answer { background: #e0f2fe; color: #0369a1; }
.case-list a:hover { background: #f0f7ff; text-decoration: none; }
.case-list a.active { background: #e8f0fe; color: #1a73e8; font-weight: 600; }
.case-list a.processed { background: #f5f5f5; color: #999; }
.case-list a.active.processed { background: #e8f0fe; color: #1a73e8; }
.case-list .pos { font-size: 12px; color: #999; }

.mid-panel { flex: 1; min-width: 280px; display: flex; flex-direction: column; overflow: hidden; }
.mid-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 8px; }
.mid-fixed { flex-shrink: 0; padding: 12px 16px; border-top: 1px solid #ddd; background: #fff; }

.right-panel { flex: 1; min-width: 200px; background: #e8e8e8; display: flex; flex-direction: column; overflow: hidden; }
.right-panel iframe { flex: 1; border: none; width: 100%; height: 100%; }
.right-panel .text-view { flex: 1; overflow-y: auto; padding: 16px; font-family: "SF Mono", Consolas, monospace; font-size: 15px; white-space: pre-wrap; word-break: break-word; background: #fff; }

.submitter-label { font-size: 14px; color: #555; }
.submitter-input { padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; font-family: inherit; width: 100px; }

/* ===== special operations (session page) ===== */
.special-wrap { position: relative; margin-left: auto; }
.special-btn { padding: 4px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; cursor: pointer; background: #fff; color: #555; }
.special-btn:hover { background: #f0f0f0; }
.special-menu { display: none; position: absolute; bottom: 100%; right: 0; margin-bottom: 4px; background: #fff; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 -2px 8px rgba(0,0,0,.12); overflow: hidden; z-index: 100; white-space: nowrap; }
.special-menu.open { display: block; }
.special-menu button { display: block; width: 100%; padding: 8px 16px; border: none; background: none; font-size: 14px; cursor: pointer; text-align: left; font-family: inherit; }
.special-menu button:hover { background: #f0f7ff; }

.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 20px; width: 400px; max-width: 90vw; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.modal h3 { font-size: 16px; margin-bottom: 12px; }
.modal textarea, .modal input[type="text"] { width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 15px; font-family: inherit; }
.modal textarea { height: 100px; resize: vertical; }
.modal .modal-btns { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.modal .modal-btns button { padding: 6px 16px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; cursor: pointer; font-family: inherit; }
.modal .modal-btns .modal-cancel { background: #fff; }
.modal .modal-btns .modal-ok { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.modal .modal-btns .modal-ok:hover { background: #1557b0; }

/* ===== login page ===== */
body.login-page { display: flex; justify-content: center; align-items: center; height: 100vh; }
.login-form { background: #fff; padding: 32px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.login-form input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 15px; width: 280px; }
.login-form button { padding: 8px 20px; background: #1a73e8; color: #fff; border: none; border-radius: 4px; font-size: 15px; cursor: pointer; margin-left: 8px; }
.login-form .err { color: #c33; font-size: 14px; margin-top: 8px; }
