[data-course-panel="history"][hidden] { display: none !important; }
.history-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 16px 0; }
.history-controls label { display: grid; gap: 6px; color: #244f43; }
.history-controls input, .history-controls select, .history-controls button { min-height: 40px; padding: 8px 12px; border: 1px solid #b9cec3; border-radius: 8px; background: #fff; color: #173e33; font: inherit; }
.history-controls button { cursor: pointer; }
.history-controls button:disabled { opacity: .5; cursor: not-allowed; }
.history-controls :focus-visible { outline: 2px solid #12624b; outline-offset: 3px; }
.history-table-scroll { overflow-x: auto; }
.history-table-scroll table { width: 100%; border-collapse: collapse; min-width: 680px; }
.history-table-scroll th, .history-table-scroll td { padding: 12px; border-bottom: 1px solid #d8e2db; text-align: left; }
.history-table-scroll th { background: #eef3ed; color: #244f43; }
[data-history-status] { color: #385d50; }
[data-history-summary] { font-size: 18px; font-weight: 600; color: #145640; }

/* Selected design: compact records workspace. Keep all selectors local. */
[data-course-panel="history"] > .panel { padding:24px 0; background:transparent; border:0; border-radius:0; box-shadow:none; font:15px/1.5 "Microsoft YaHei","PingFang SC",system-ui,sans-serif; }
.history-heading { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:24px; }
.history-heading h3 { margin:0; font-size:28px; line-height:1.3; color:#123f33; }
[data-course-panel="history"] button,[data-course-panel="history"] input,[data-course-panel="history"] select,.history-export-menu summary { min-height:40px; box-sizing:border-box; padding:8px 14px; border:1px solid #b9cec3; border-radius:6px; background:#fffefa; color:#234c40; font:inherit; }
[data-course-panel="history"] button,.history-export-menu summary { cursor:pointer; }
[data-course-panel="history"] button:hover,.history-export-menu summary:hover { background:#e8efe8; }
[data-course-panel="history"] button:disabled { opacity:.45; cursor:not-allowed; }
[data-course-panel="history"] :focus-visible { outline:2px solid #12624b; outline-offset:3px; }
.history-controls { margin:0 0 24px; display:grid; gap:20px; }
.history-date-filters,.history-detail-filters,.history-presets { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.history-date-filters,.history-detail-filters { gap:22px; }
.history-controls label { display:flex; align-items:center; gap:12px; white-space:nowrap; }
.history-controls input { width:180px; min-width:0; }
.history-controls select { width:170px; min-width:0; }
[data-course-panel="history"] button[type="submit"] { background:#155d49; color:#fff; border-color:#155d49; font-weight:600; }
.history-export-menu { position:relative; flex-shrink:0; }
.history-export-menu summary { min-width:140px; text-align:center; }
.history-export-options { position:absolute; right:0; top:calc(100% + 8px); min-width:210px; padding:8px; background:#fff; border:1px solid #e1e6df; border-radius:8px; box-shadow:0 8px 24px #183b3014; z-index:10; }
.history-export-options button { display:block; width:100%; border:0; text-align:left; white-space:nowrap; background:transparent; }
.history-result-bar { display:flex; align-items:center; justify-content:space-between; gap:12px 28px; flex-wrap:wrap; margin:0 0 18px; }
.history-result-bar p { margin:0; }
[data-history-summary] { font-weight:700; }
[data-history-status] { font-size:12px; color:#63766d; }
.history-table-scroll table { min-width:900px; font-size:15px; font-variant-numeric:tabular-nums; }
.history-table-scroll th,.history-table-scroll td { padding:12px 18px; border:0; line-height:1.5; }
.history-table-scroll th { background:#e9f0e9; color:#214b3e; font-weight:700; white-space:nowrap; }
.history-table-scroll td { background:#fffdf8; color:#344c43; }
.history-table-scroll tr:nth-child(even) td { background:#f2f0e9; }
.history-table-scroll tr:hover td { background:#eaf1e9; }
.history-table-scroll td:first-child,.history-table-scroll td:nth-child(2),.history-table-scroll td:last-child { white-space:nowrap; }
.history-state { display:inline-block; padding:3px 12px; border-radius:20px; background:#eceeea; color:#536259; font-size:13px; }
.history-state[data-state="completed"] { background:#ddefdf; color:#155d49; }
.history-state[data-state="unchecked"] { background:#ffebc9; color:#785211; }
.history-state[data-state="cancelled"] { background:#e6e7e6; color:#57605c; }
.history-footer { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-top:22px; }
.history-footer p { margin:0; max-width:720px; font-size:12px; color:#687970; }
.history-pagination { display:flex; align-items:center; gap:12px; font-size:12px; }
.history-pagination button { white-space:nowrap; font-size:13px; }
#courses:has([data-course-panel="history"]:not([hidden])) [role="tablist"]:has([data-course-tab]) { background:#194d3e; border-color:#194d3e; border-radius:0; padding:0 16px; }
#courses:has([data-course-panel="history"]:not([hidden])) [data-course-tab] { background:transparent; color:#dfece4; border:0; border-bottom:3px solid transparent; border-radius:0; min-height:50px; box-shadow:none; }
#courses:has([data-course-panel="history"]:not([hidden])) [data-course-tab][aria-selected="true"] { color:#fff; border-bottom-color:#e7dcb5; font-weight:700; }
@media(max-width:1100px) { .history-detail-filters { gap:16px; } .history-footer { align-items:flex-start; flex-direction:column; } }
@media(max-width:600px) { [data-course-panel="history"] > .panel { padding:18px 0; } .history-heading h3 { font-size:23px; } .history-heading { gap:12px; } .history-export-menu summary { min-width:108px; } .history-date-filters,.history-detail-filters { display:grid; grid-template-columns:1fr 1fr; gap:14px 12px; } .history-controls label { display:grid; gap:6px; } .history-controls input,.history-controls select { width:100%; } .history-presets { grid-column:1/-1; } [data-history-summary] { font-size:16px; line-height:1.8; } .history-pagination { flex-wrap:wrap; } }

.history-controls .history-state-options { margin:0; padding:8px 12px; border:1px solid #bccfc4; border-radius:8px; min-width:0; display:flex; flex-wrap:wrap; gap:10px 16px; }
.history-state-options legend { padding:0 4px; font-size:13px; }
.history-controls .history-state-options label { display:flex; flex-direction:row; align-items:center; gap:6px; white-space:nowrap; cursor:pointer; }
.history-controls .history-state-options input { width:16px; height:16px; min-height:0; margin:0; padding:0; accent-color:#155d49; }
