.law-hero,
.law-section-nav,
.law-dashboard-grid,
.law-list-heading,
.law-filter-panel,
.law-card-list,
.law-panel {
    width: min(1120px, calc(100% - 28px));
    margin-inline: auto;
}

.law-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 18px;
    align-items: end;
    padding: 28px 0 16px;
}

.law-kicker {
    margin: 0 0 6px;
    color: #5eead4;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.law-hero h1,
.law-list-heading h2 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.law-hero p:not(.law-kicker) {
    max-width: 680px;
    margin: 12px 0 0;
    color: #cbd5e1;
    line-height: 1.75;
}

.law-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.law-hero-stats div,
.law-panel,
.law-card,
.law-filter-panel {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.76);
    border-radius: 8px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
}

.law-hero-stats div {
    min-height: 86px;
    padding: 14px;
    display: grid;
    align-content: center;
    gap: 4px;
}

.law-hero-stats span,
.law-score span,
.law-card-meta,
.law-card-foot,
.law-empty,
.law-related,
.law-log-list article span,
.law-mini-list span {
    color: #94a3b8;
    font-size: 0.86rem;
}

.law-hero-stats strong {
    color: #f8fafc;
    font-size: 1.55rem;
    line-height: 1;
}

.law-section-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0 14px;
}

.law-section-nav a,
.law-shortcuts a,
.law-count-grid a,
.law-filter-panel a,
.law-admin-link,
.law-card-controls button,
.law-mini-button,
.law-choice-list button,
.law-filter-panel button {
    min-height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.74);
    color: #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    box-sizing: border-box;
    font: inherit;
}

.law-section-nav a {
    white-space: nowrap;
}

.law-section-nav a.active,
.law-shortcuts a:hover,
.law-count-grid a:hover,
.law-filter-panel button,
.law-admin-link {
    border-color: rgba(94, 234, 212, 0.54);
    background: rgba(20, 184, 166, 0.16);
    color: #ecfeff;
}

.law-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding-bottom: 24px;
}

.law-panel {
    padding: 16px;
}

.law-panel h2,
.law-card h2,
.law-thesis-grid h3 {
    margin: 0 0 10px;
    color: #f8fafc;
    letter-spacing: 0;
}

.law-shortcuts,
.law-count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}

.law-count-grid a {
    justify-content: space-between;
    gap: 10px;
}

.law-count-grid strong {
    color: #facc15;
    font-size: 1.35rem;
}

.law-mini-list,
.law-log-list {
    display: grid;
    gap: 8px;
}

.law-mini-list--after {
    margin-top: 10px;
}

.law-mini-list a,
.law-log-list article {
    display: grid;
    gap: 3px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.5);
    border-radius: 8px;
    padding: 10px;
    text-decoration: none;
}

.law-mini-list strong,
.law-log-list strong {
    color: #f8fafc;
    word-break: break-word;
}

.law-notice,
.law-empty {
    border: 1px dashed rgba(148, 163, 184, 0.34);
    background: rgba(2, 6, 23, 0.52);
    border-radius: 8px;
    padding: 14px;
}

.law-notice {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto 12px;
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
}

.law-list-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 0 12px;
}

.law-list-heading h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.law-card-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.law-filter-panel {
    padding: 12px;
    margin-bottom: 12px;
}

.law-filter-panel form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(5, minmax(120px, 150px)) auto auto auto;
    gap: 8px;
    align-items: center;
}

.law-filter-panel input,
.law-filter-panel select {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.78);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    font: inherit;
}

.law-check {
    color: #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    white-space: nowrap;
}

.law-check input {
    width: auto;
    min-height: auto;
}

.law-card-list {
    display: grid;
    gap: 12px;
    padding-bottom: 28px;
}

.law-card {
    padding: 16px;
}

.law-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.law-card h2 {
    font-size: 1.25rem;
    line-height: 1.35;
}

.law-card-meta {
    margin: 0 0 5px;
}

.law-score {
    min-width: 88px;
    border: 1px solid rgba(94, 234, 212, 0.28);
    background: rgba(20, 184, 166, 0.08);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
}

.law-score strong {
    display: block;
    color: #5eead4;
    font-size: 1.05rem;
}

.law-alert {
    color: #fde68a;
    border: 1px solid rgba(250, 204, 21, 0.3);
    background: rgba(113, 63, 18, 0.24);
    border-radius: 8px;
    padding: 8px 10px;
}

.law-markdown,
.law-lawtext,
.law-explanation,
.law-exam-point,
.law-answer-detail {
    color: #e2e8f0;
    line-height: 1.75;
}

.law-markdown h2,
.law-markdown h3,
.law-markdown h4 {
    margin: 16px 0 8px;
    color: #f8fafc;
    font-size: 1.1rem;
}

.law-related {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.law-related span,
.law-tags a,
.law-article-number {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.56);
    border-radius: 999px;
    padding: 4px 9px;
}

.law-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.law-tags a {
    color: #bfdbfe;
    text-decoration: none;
    font-size: 0.84rem;
}

.law-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.law-card-foot a {
    color: #5eead4;
}

.law-flashcard {
    display: grid;
    gap: 10px;
}

.law-term-card {
    display: grid;
    gap: 10px;
}

.law-flashface {
    min-height: 130px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(2, 6, 23, 0.62);
    border-radius: 8px;
    padding: 14px;
}

.law-flashface span {
    display: inline-flex;
    color: #5eead4;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.law-flashface p {
    color: #f8fafc;
    font-size: 1.1rem;
    line-height: 1.7;
}

.law-flashface small {
    color: #94a3b8;
}

.law-flashback {
    display: none;
}

.law-flashcard.is-flipped .law-flashfront {
    display: none;
}

.law-flashcard.is-flipped .law-flashback {
    display: block;
}

.law-question {
    color: #f8fafc;
    line-height: 1.75;
}

.law-choice-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.law-choice-list--binary {
    grid-template-columns: repeat(2, minmax(100px, 160px));
}

.law-choice-list button {
    justify-content: flex-start;
    text-align: left;
    min-height: 46px;
}

.law-choice-list button.is-correct {
    border-color: rgba(52, 211, 153, 0.7);
    background: rgba(6, 95, 70, 0.32);
}

.law-choice-list button.is-wrong {
    border-color: rgba(248, 113, 113, 0.72);
    background: rgba(127, 29, 29, 0.34);
}

.law-choice-list button:disabled,
.law-study-choices button:disabled {
    cursor: default;
    opacity: 0.92;
}

.law-judge {
    min-height: 1.4em;
    font-weight: 800;
}

.law-judge.is-correct {
    color: #86efac;
}

.law-judge.is-wrong {
    color: #fca5a5;
}

.law-explanation {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(2, 6, 23, 0.48);
    border-radius: 8px;
    padding: 12px;
}

.law-table-scroll {
    overflow-x: auto;
}

.law-comparison-table,
.law-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.law-comparison-table th,
.law-comparison-table td,
.law-admin-table th,
.law-admin-table td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.law-comparison-table th,
.law-admin-table th {
    color: #cbd5e1;
    background: rgba(2, 6, 23, 0.62);
    font-weight: 700;
}

.law-article-number {
    display: inline-flex;
    color: #fde68a;
    margin: 4px 0 10px;
}

.law-lawtext {
    border-left: 3px solid rgba(94, 234, 212, 0.58);
    padding-left: 12px;
}

.law-exam-point {
    border: 1px solid rgba(250, 204, 21, 0.28);
    background: rgba(113, 63, 18, 0.2);
    border-radius: 8px;
    padding: 10px;
}

.law-thesis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.law-thesis-grid section {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.45);
    border-radius: 8px;
    padding: 12px;
}

.law-answer-detail {
    margin-top: 10px;
}

.law-answer-detail summary {
    cursor: pointer;
    color: #5eead4;
}

.law-term-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.law-term-status span {
    border: 1px solid rgba(94, 234, 212, 0.28);
    background: rgba(20, 184, 166, 0.1);
    color: #ccfbf1;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.84rem;
}

.law-term-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.law-term-grid section {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.44);
    border-radius: 8px;
    padding: 12px;
}

.law-term-grid h3 {
    margin: 0 0 8px;
    color: #f8fafc;
    font-size: 0.98rem;
}

.law-term-grid p {
    color: #e2e8f0;
    line-height: 1.65;
}

.law-trend {
    min-height: 110px;
    display: flex;
    gap: 8px;
    align-items: end;
    padding: 10px 0 16px;
    overflow-x: auto;
}

.law-trend div {
    width: 38px;
    min-width: 38px;
    height: 100px;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 4px;
    align-items: end;
}

.law-trend span {
    width: 100%;
    min-height: 8px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #5eead4, #60a5fa);
}

.law-trend small {
    color: #94a3b8;
    font-size: 0.72rem;
    text-align: center;
}

.law-panel--study {
    grid-column: 1 / -1;
}

.law-study-launch,
.law-one-tap-list {
    display: grid;
    gap: 8px;
}

.law-study-launch {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.law-study-launch a,
.law-one-tap-list a {
    min-height: 54px;
    border: 1px solid rgba(94, 234, 212, 0.34);
    background: rgba(20, 184, 166, 0.12);
    color: #ecfeff;
    border-radius: 8px;
    text-decoration: none;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 10px;
    box-sizing: border-box;
}

.law-study-launch strong {
    color: #facc15;
    font-size: 1.25rem;
    line-height: 1;
}

.law-one-tap-list {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    margin-top: 10px;
}

.law-one-tap-list a {
    min-height: 42px;
    text-align: center;
}

.law-study-shell {
    width: min(760px, calc(100% - 28px));
    margin: 0 auto;
    padding: 12px 0 30px;
}

.law-study-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.law-study-topbar a,
.law-study-topbar div,
.law-study-filter,
.law-study-card,
.law-study-detail__panel {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.82);
    border-radius: 8px;
}

.law-study-topbar a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    color: #e2e8f0;
    text-decoration: none;
    padding: 7px 11px;
}

.law-study-topbar div {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: #94a3b8;
    padding: 8px 11px;
}

.law-study-topbar strong {
    color: #f8fafc;
}

.law-study-filter {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.law-study-filter-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.law-study-filter-field span {
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.15;
}

.law-study-filter input,
.law-study-filter select,
.law-study-filter button {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.78);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    font: inherit;
}

.law-study-filter button {
    align-self: end;
    border-color: rgba(94, 234, 212, 0.54);
    background: rgba(20, 184, 166, 0.2);
    color: #ecfeff;
    cursor: pointer;
}

.law-study-progress {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.86);
    margin-bottom: 10px;
}

.law-study-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5eead4, #facc15);
}

.law-study-stage {
    min-height: 390px;
    display: grid;
}

.law-study-card {
    min-height: 390px;
    padding: 18px;
    display: grid;
    grid-template-rows: auto minmax(120px, 1fr) auto auto;
    align-items: center;
    touch-action: auto;
    user-select: text;
}

.law-study-meta {
    min-height: 1.3em;
    margin: 0;
    color: #94a3b8;
    font-size: 0.84rem;
    text-align: center;
}

.law-study-card h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 2.35rem;
    line-height: 1.28;
    text-align: center;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.law-study-choices {
    display: grid;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.law-study-choices:empty {
    display: none;
}

.law-study-choices button {
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.68);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    text-align: left;
}

.law-study-choices button.is-selected {
    border-color: rgba(250, 204, 21, 0.72);
}

.law-study-choices button.is-correct {
    border-color: rgba(52, 211, 153, 0.72);
    background: rgba(6, 95, 70, 0.32);
}

.law-study-choices button.is-wrong {
    border-color: rgba(248, 113, 113, 0.72);
    background: rgba(127, 29, 29, 0.34);
}

.law-study-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.law-study-input[hidden] {
    display: none;
}

.law-study-input input,
.law-study-input button {
    min-height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.72);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    font: inherit;
}

.law-study-input button {
    min-width: 86px;
    cursor: pointer;
}

.law-study-answer {
    width: 100%;
    margin-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    color: #ccfbf1;
    font-size: 1.28rem;
    line-height: 1.65;
    text-align: center;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    padding-top: 14px;
}

.law-study-actions,
.law-study-subactions {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.law-study-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.law-study-subactions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.law-study-status {
    min-height: 1.4em;
    margin: 8px 0 0;
    color: #94a3b8;
    font-size: 0.86rem;
    text-align: center;
}

.law-study-actions button,
.law-study-subactions button {
    min-height: 48px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.78);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 9px 10px;
    box-sizing: border-box;
    font: inherit;
    cursor: pointer;
}

.law-study-actions .law-study-primary {
    grid-column: span 4;
    border-color: rgba(94, 234, 212, 0.62);
    background: rgba(20, 184, 166, 0.22);
    color: #ecfeff;
    font-weight: 800;
}

.law-study-actions [data-law-study-grade] {
    display: none;
}

.law-study-shell.is-answer-visible .law-study-primary {
    display: none;
}

.law-study-shell.is-choice-card .law-study-primary {
    display: none;
}

.law-study-shell.is-choice-card:not(.is-answer-visible) [data-law-study-detail-open] {
    grid-column: 1 / -1;
}

.law-study-shell.is-answer-visible .law-study-actions [data-law-study-grade] {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.law-study-detail {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: end center;
    background: rgba(2, 6, 23, 0.72);
    padding: 16px;
    box-sizing: border-box;
}

.law-study-detail[hidden] {
    display: none;
}

.law-study-detail__panel {
    width: min(760px, 100%);
    max-height: min(78vh, 720px);
    overflow-y: auto;
    padding: 14px;
}

.law-study-detail__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.law-study-detail__head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.25rem;
    overflow-wrap: anywhere;
}

.law-study-detail__head button {
    min-height: 38px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.78);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 7px 11px;
    font: inherit;
}

.law-study-detail__body {
    display: grid;
    gap: 10px;
}

.law-study-detail__body section {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(2, 6, 23, 0.48);
    border-radius: 8px;
    padding: 10px;
}

.law-study-detail__body h3 {
    margin: 0 0 6px;
    color: #5eead4;
    font-size: 0.94rem;
}

.law-study-detail__body p {
    margin: 0;
    color: #e2e8f0;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

body.law-study-detail-open {
    overflow: hidden;
}

@media (max-width: 980px) {
    .law-hero {
        grid-template-columns: 1fr;
    }

    .law-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .law-filter-panel form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .law-study-launch,
    .law-study-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .law-hero,
    .law-section-nav,
    .law-dashboard-grid,
    .law-list-heading,
    .law-filter-panel,
    .law-card-list,
    .law-panel,
    .law-notice {
        width: min(100% - 20px, 1120px);
    }

    .law-hero {
        padding-top: 18px;
    }

    .law-hero h1 {
        font-size: 2.15rem;
    }

    .law-hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .law-filter-panel form,
    .law-card-head,
    .law-thesis-grid,
    .law-term-grid {
        grid-template-columns: 1fr;
    }

    .law-score {
        width: 100%;
        text-align: left;
    }

    .law-choice-list,
    .law-choice-list--binary {
        grid-template-columns: 1fr;
    }

    .law-card {
        padding: 13px;
    }

    .law-study-shell {
        width: min(100% - 20px, 760px);
        padding-top: 8px;
    }

    .law-study-launch,
    .law-one-tap-list,
    .law-study-filter,
    .law-study-actions,
    .law-study-subactions {
        grid-template-columns: 1fr 1fr;
    }

    .law-study-actions .law-study-primary {
        grid-column: span 2;
    }

    .law-study-card,
    .law-study-stage {
        min-height: 360px;
    }

    .law-study-card {
        padding: 14px;
    }

    .law-study-card h2 {
        font-size: 1.85rem;
    }

    .law-study-input {
        grid-template-columns: 1fr;
    }

    .law-study-answer {
        font-size: 1.08rem;
    }

    .law-study-detail {
        padding: 10px;
    }
}
