:root {
    --bg: #fff9ee;
    --ink: #243044;
    --muted: #6d7483;
    --line: #eadfc9;
    --green: #1f8a70;
    --blue: #2f6fe4;
    --red: #d94e4b;
    --yellow: #ffd86b;
    --pink: #ffe5ee;
    --mint: #dff6ed;
    --paper: #fffdf7;
    --shadow: 0 18px 48px rgba(36, 48, 68, 0.16);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 249, 238, 0.98), rgba(242, 250, 246, 0.98)),
        var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    max-width: 100%;
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

img,
iframe {
    max-width: 100%;
}

.hero-carousel {
    position: relative;
    height: clamp(320px, 52svh, 560px);
    min-height: 320px;
    overflow: hidden;
    background: #111827;
}

.slide-track {
    display: flex;
    height: 100%;
    transition: transform 0.55s ease;
}

.slide {
    flex: 0 0 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(13, 19, 32, 0.2), rgba(13, 19, 32, 0.66)),
        radial-gradient(circle at center, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.35));
}

.hero-center {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 28px;
    color: white;
    text-align: center;
}

.hero-center h1 {
    max-width: min(920px, 92vw);
    margin: 0;
    font-size: clamp(34px, 11vw, 72px);
    line-height: 1;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
    text-shadow: 0 8px 30px rgba(0, 0, 0, 0.36);
}

.hero-center p {
    max-width: min(720px, 88vw);
    margin: 12px 0 0;
    font-size: clamp(14px, 3.8vw, 24px);
    font-weight: 800;
    line-height: 1.35;
    text-wrap: balance;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.slide-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 18px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.slide-dots button {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
}

.slide-dots button.active {
    width: 28px;
    background: white;
}

.praise-section,
.commendation-section,
.activity-section,
.teacher-dock,
.site-footer {
    width: min(1160px, calc(100% - 28px));
    margin: 0 auto;
}

.praise-section {
    padding: 18px 0 0;
}

.wall-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.wall-title-row > * {
    min-width: 0;
}

.wall-title-row h2 {
    margin: 0;
    font-size: clamp(24px, 5vw, 36px);
    letter-spacing: 0;
    white-space: nowrap;
}

.wall-title-row.compact {
    margin-top: 18px;
}

.wall-title-row.compact h2 {
    font-size: clamp(21px, 6vw, 30px);
}

.wall-controls {
    display: grid;
    grid-template-columns: 62px 72px;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.wall-controls > * {
    min-width: 0;
}

.wall-controls select {
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    min-height: 38px;
    padding: 0 4px;
    text-overflow: ellipsis;
    appearance: none;
    background-image: none;
    text-align: center;
}

.wall-controls input {
    width: 72px;
    min-height: 38px;
    padding: 0 8px;
}

.section-head {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.section-head p,
.teacher-top p {
    margin: 0 0 6px;
    color: var(--green);
    font-size: 13px;
    font-weight: 900;
}

.section-head h2,
.teacher-top h2 {
    margin: 0;
    font-size: clamp(28px, 8vw, 48px);
    letter-spacing: 0;
}

.search-box {
    display: grid;
    gap: 7px;
}

.search-box span,
label span,
fieldset legend {
    color: #3f4959;
    font-size: 14px;
    font-weight: 900;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    outline: none;
}

input,
select {
    min-height: 46px;
    padding: 0 12px;
}

textarea {
    min-height: 112px;
    padding: 12px;
    line-height: 1.65;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31, 138, 112, 0.14);
}

.wall-frame {
    border: 1px solid #e0cda5;
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(224, 205, 165, 0.4) 1px, transparent 1px),
        linear-gradient(rgba(224, 205, 165, 0.42) 1px, transparent 1px),
        #fff6dd;
    background-size: 28px 28px;
    box-shadow: var(--shadow);
    padding: 12px;
}

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

.sticky-note {
    position: relative;
    min-height: clamp(112px, 34vw, 150px);
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px 12px 12px;
    border-radius: 4px;
    box-shadow: 0 14px 24px rgba(36, 48, 68, 0.14);
    transform: rotate(-0.7deg);
}

.sticky-note:nth-child(2n) {
    transform: rotate(0.6deg);
}

.tone-0 {
    background: #fff2a8;
}

.tone-1 {
    background: #dff6ed;
}

.tone-2 {
    background: #dfeaff;
}

.tone-3 {
    background: #ffe2ec;
}

.tone-4 {
    background: #f0e7ff;
}

.pin {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    transform: translateX(-50%);
}

.sticky-note header,
.sticky-note footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 8px;
}

.sticky-note strong {
    overflow-wrap: anywhere;
    font-size: clamp(15px, 4.4vw, 19px);
}

.sticky-note small,
.sticky-note footer {
    color: rgba(36, 48, 68, 0.66);
    font-size: 12px;
    font-weight: 800;
}

.sticky-note p {
    margin: 0;
    line-height: 1.5;
    font-size: clamp(13px, 3.7vw, 16px);
    overflow-wrap: anywhere;
}

.wall-more {
    display: flex;
    justify-content: center;
    padding-top: 12px;
}

.commendation-section {
    padding-top: 4px;
}

.commendation-list {
    display: grid;
    gap: 10px;
}

.commendation-card {
    display: grid;
    gap: 6px;
    border: 1px solid #f0d897;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff7c8, #fffdf0);
    box-shadow: 0 10px 22px rgba(36, 48, 68, 0.08);
    padding: 12px;
}

.commendation-card strong {
    font-size: 17px;
}

.commendation-card p {
    margin: 0;
    line-height: 1.55;
}

.commendation-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.all-sticky-wall {
    max-height: min(68vh, 640px);
    overflow: auto;
    padding: 2px;
}

.activity-section {
    padding: 18px 0 8px;
    scroll-margin-top: 18px;
}

.small-link,
.quiet-btn,
.danger-btn,
.primary-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0 14px;
    font-weight: 900;
}

.small-link,
.quiet-btn {
    border: 1px solid var(--line);
    background: white;
    color: var(--ink);
}

.primary-btn {
    background: var(--green);
    color: white;
}

.danger-btn {
    background: #fff0ef;
    color: var(--red);
    border: 1px solid #ffd0cd;
}

.activity-board {
    display: block;
}

.activity-cover {
    min-height: 128px;
    display: grid;
    align-content: end;
    gap: 6px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    background-color: #1e293b;
    background-size: cover;
    background-position: center;
    color: white;
    box-shadow: 0 12px 26px rgba(36, 48, 68, 0.08);
    position: relative;
}

.activity-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 16, 28, 0.1), rgba(10, 16, 28, 0.72));
}

.activity-cover > * {
    position: relative;
}

.activity-cover span,
.activity-cover em {
    font-style: normal;
    font-size: 13px;
    font-weight: 900;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    padding: 18px 0 92px;
    color: var(--muted);
    font-size: 12px;
}

.site-footer a {
    color: var(--muted);
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: auto;
    min-width: 0;
    transform: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: 58px;
    overflow: hidden;
    border: 1px solid rgba(234, 223, 201, 0.92);
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.bottom-nav a,
.bottom-nav button {
    width: 100%;
    min-width: 0;
    display: grid;
    place-items: center;
    background: transparent;
    color: #3f4959;
    font-size: 14px;
    font-weight: 900;
}

.app-dialog {
    width: min(520px, calc(100% - 28px));
    border: 0;
    border-radius: 8px;
    padding: 0;
    background: transparent;
}

.wide-dialog {
    width: min(920px, calc(100% - 28px));
}

.teacher-dialog {
    width: min(1040px, calc(100% - 24px));
    max-height: min(86vh, 900px);
    overflow: auto;
}

.app-dialog::backdrop {
    background: rgba(24, 31, 44, 0.45);
    backdrop-filter: blur(3px);
}

.dialog-card,
.teacher-login,
.teacher-workspace {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.dialog-card {
    position: relative;
    display: grid;
    gap: 14px;
    padding: 20px;
}

.dialog-card h2 {
    margin: 0;
}

.dialog-close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f3eee4;
    color: var(--ink);
    font-size: 22px;
    line-height: 1;
}

.choice-grid {
    display: grid;
    gap: 12px;
}

.choice-card {
    min-height: 106px;
    display: grid;
    align-content: center;
    gap: 8px;
    border-radius: 8px;
    padding: 16px;
    background: var(--mint);
    color: var(--ink);
    text-align: left;
}

.choice-card:nth-child(2) {
    background: var(--pink);
}

.choice-card.secret-choice {
    background: #f0e7ff;
}

.choice-card strong {
    font-size: 22px;
}

.choice-card span {
    color: var(--muted);
}

.submit-card label,
.settings-form label,
.teacher-login label {
    display: grid;
    gap: 7px;
}

.visibility-field {
    display: grid;
    gap: 8px;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
}

.visibility-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-weight: 700;
}

.visibility-field input {
    width: auto;
    min-height: 0;
}

.form-message {
    min-height: 22px;
    margin: 0;
    color: var(--green);
    font-weight: 900;
    line-height: 1.6;
}

.form-message.is-error {
    color: var(--red);
}

.teacher-dock {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
}

.teacher-login {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.teacher-workspace {
    display: none;
    gap: 18px;
    padding: 16px;
}

.teacher-active .teacher-login {
    display: none;
}

.teacher-active .teacher-workspace {
    display: grid;
}

.teacher-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.settings-form {
    display: grid;
    gap: 12px;
}

.admin-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 4;
    background: rgba(255, 253, 247, 0.96);
    padding: 4px 0;
}

.admin-tab {
    min-height: 38px;
    border-radius: 8px;
    background: #edf3ff;
    color: #274268;
    font-size: 13px;
    font-weight: 900;
    padding: 0 6px;
    white-space: nowrap;
}

.admin-tab.active {
    background: var(--green);
    color: white;
}

.settings-form h3 {
    margin: 8px 0 0;
}

.carousel-settings {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    padding: 12px;
}

.admin-group,
.commendation-form,
.teacher-table-panel {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    padding: 12px;
}

.admin-hint {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.carousel-row {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.teacher-actions {
    display: grid;
    gap: 10px;
}

.teacher-actions > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tab {
    min-height: 40px;
    border-radius: 8px;
    padding: 0 12px;
    background: #edf3ff;
    color: #274268;
    font-weight: 900;
}

.tab.active {
    background: var(--green);
    color: white;
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

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

.admin-row p {
    margin: 7px 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.admin-row span {
    color: var(--muted);
    font-size: 12px;
}

.row-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row-actions button {
    min-height: 36px;
    border-radius: 8px;
    padding: 0 12px;
    background: var(--green);
    color: white;
    font-weight: 900;
}

.row-actions button[data-action="reject"] {
    background: var(--red);
}

.row-actions button[data-action="delete"] {
    background: #3f4959;
}

.empty-state {
    min-height: 116px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
    padding: 16px;
}

.compact-empty {
    min-height: 76px;
}

@media (min-width: 720px) {
    .hero-center h1 {
        font-size: clamp(72px, 8vw, 112px);
    }

    .section-head {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
        align-items: end;
    }

    .sticky-wall {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .activity-cover {
        min-height: 180px;
    }

    .commendation-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .settings-form,
    .commendation-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-form .wide,
    .commendation-form .wide {
        grid-column: 1 / -1;
    }

    .carousel-row {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
        align-items: end;
    }

    .admin-row {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: start;
    }

    .row-actions {
        grid-column: auto;
        justify-content: flex-end;
    }
}

@media (min-width: 1024px) {
    .sticky-wall {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hero-carousel {
        height: 62vh;
    }
}

@media (max-width: 390px) {
    .hero-center h1 {
        font-size: clamp(32px, 10.5vw, 42px);
    }

    .hero-center p {
        font-size: 14px;
    }
}

@media (max-width: 720px) {
    .hero-carousel {
        height: clamp(300px, 48svh, 420px);
        min-height: 300px;
    }

    .hero-center {
        padding: 18px;
    }

    .bottom-nav {
        grid-template-columns: repeat(4, 25%);
    }

    .bottom-nav {
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
    }

    .wall-title-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
    }

    .wall-title-row h2 {
        font-size: 24px;
        white-space: nowrap;
    }

    .wall-controls {
        display: grid;
        grid-template-columns: 58px 58px;
        gap: 5px;
    }

    .wall-controls select {
        width: 58px;
        min-width: 58px;
        max-width: 58px;
        font-size: 12px;
        padding-inline: 3px;
        text-align: center;
    }

    .wall-controls input {
        width: 58px;
        font-size: 12px;
        padding-inline: 6px;
    }

    .bottom-nav a,
    .bottom-nav button {
        font-size: 13px;
    }

    .admin-tabs {
        grid-template-columns: repeat(5, minmax(48px, 1fr));
        overflow-x: auto;
    }

    .admin-tab {
        font-size: 12px;
        padding: 0 4px;
    }
}
