/* ===========================================================
   朱家角中学广播社点歌台 —— 前台样式
   配色取自江南水乡：米白纸面、青绿墙色、暖橙点缀
   =========================================================== */

:root {
    --ink: #16323a;
    --ink-soft: #4f6873;
    --ink-faint: #8a9ba3;
    --teal: #1e6f68;
    --teal-deep: #14524f;
    --teal-tint: #e7f1ee;
    --sand: #f6f2ea;
    --orange: #cf7f3c;
    --red: #b0433a;
    --line: rgba(22, 50, 58, .1);
    --white: #fff;
    --radius: 16px;
    --shadow: 0 12px 32px rgba(20, 82, 79, .07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Source Han Sans SC", sans-serif;
    color: var(--ink);
    line-height: 1.6;
    background-color: var(--sand);
    background-image:
        radial-gradient(1200px 480px at 12% -10%, rgba(30, 111, 104, .14), transparent 62%),
        radial-gradient(900px 420px at 92% 0%, rgba(207, 127, 60, .12), transparent 58%),
        linear-gradient(180deg, #f8f5ee 0%, #eef3ef 100%);
    background-attachment: fixed;
}

.page {
    width: min(1120px, 100% - 32px);
    margin: 0 auto;
    padding: 32px 0 48px;
}

/* ---------------- 顶部 ---------------- */
.masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.masthead__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.masthead__mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 24px;
    color: #fff;
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-deep) 100%);
    box-shadow: 0 8px 18px rgba(20, 82, 79, .26);
}

.masthead__title {
    margin: 0;
    font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif;
    font-size: clamp(20px, 2.6vw, 27px);
    font-weight: 600;
    letter-spacing: .5px;
    color: var(--teal-deep);
}

.masthead__sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ink-soft);
}

.channel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid transparent;
}

.channel.is-open {
    color: #14624f;
    background: #e3f3ea;
    border-color: rgba(20, 98, 79, .18);
}

.channel.is-closed {
    color: #8a4a2b;
    background: #fbeee2;
    border-color: rgba(138, 74, 43, .18);
}

.channel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.channel.is-open .channel__dot {
    box-shadow: 0 0 0 4px rgba(20, 98, 79, .14);
    animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

/* ---------------- 通知 / 闪存 ---------------- */
.notice,
.flash {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 13px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .78);
}

.notice strong {
    color: var(--teal-deep);
    white-space: nowrap;
}

.notice strong::after { content: "："; }

.flash--ok {
    color: #14624f;
    background: #e8f6ee;
    border-color: rgba(20, 98, 79, .22);
}

.flash--error {
    color: #8f2f28;
    background: #fbeae8;
    border-color: rgba(143, 47, 40, .2);
}

/* ---------------- 栅格 ---------------- */
.grid {
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    gap: 20px;
    align-items: start;
}

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 22px 24px;
}

.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--line);
}

.card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .3px;
    color: var(--teal-deep);
}

.card__title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 15px;
    margin-right: 9px;
    vertical-align: -2px;
    border-radius: 2px;
    background: var(--orange);
}

.card__hint {
    font-size: 12.5px;
    color: var(--ink-faint);
}

/* ---------------- 表单 ---------------- */
.form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }

.field__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
}

.field__label em {
    font-style: normal;
    color: var(--orange);
}

.field__opt {
    font-weight: 400;
    font-size: 12px;
    color: var(--ink-faint);
}

.input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: #fbfaf7;
    border: 1px solid rgba(22, 50, 58, .14);
    border-radius: 10px;
    transition: border-color .15s, box-shadow .15s, background .15s;
    appearance: none;
}

.input::placeholder { color: #a9b6bb; }

.input:focus {
    outline: none;
    background: #fff;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(30, 111, 104, .13);
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--teal);
    flex: none;
}

.form__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 26px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    text-decoration: none;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .12s, box-shadow .15s, filter .15s;
}

.btn--primary {
    background: linear-gradient(145deg, #237a71, var(--teal-deep));
    box-shadow: 0 8px 20px rgba(20, 82, 79, .24);
}

.btn--primary:hover { filter: brightness(1.06); }
.btn--primary:active { transform: translateY(1px); }

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

.form__tip {
    margin: 0;
    font-size: 12px;
    color: var(--ink-faint);
}

/* 通道关闭 */
.closed-box {
    padding: 34px 20px;
    text-align: center;
    border-radius: 12px;
    background: linear-gradient(180deg, #fdf7ef, #f8f2e7);
    border: 1px dashed rgba(207, 127, 60, .34);
}

.closed-box__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: #8a4a2b;
}

.closed-box__text {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

/* ---------------- 待放列表 ---------------- */
.card--queue { position: sticky; top: 24px; }

.queue {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.queue__item {
    display: flex;
    gap: 14px;
    padding: 12px 6px;
    border-bottom: 1px solid rgba(22, 50, 58, .06);
}

.queue__item:last-child { border-bottom: 0; }

.queue__item.is-pinned {
    background: linear-gradient(90deg, rgba(207, 127, 60, .08), transparent 65%);
    border-radius: 10px;
}

.queue__no {
    flex: none;
    width: 30px;
    font-size: 13px;
    font-weight: 700;
    color: var(--teal);
    font-variant-numeric: tabular-nums;
    padding-top: 3px;
    letter-spacing: .5px;
}

.queue__body { min-width: 0; flex: 1; }

.queue__title {
    margin: 0;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--ink);
    word-break: break-word;
}

.queue__artist {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--ink-soft);
}

.queue__meta {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--ink-faint);
    word-break: break-word;
}

.tag {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 5px;
    vertical-align: 2px;
}

.tag--pin {
    color: #8a4a2b;
    background: #fbeada;
}

.empty {
    padding: 46px 16px;
    text-align: center;
}

.empty__title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-soft);
}

.empty__text {
    margin: 0;
    font-size: 13px;
    color: var(--ink-faint);
}

/* 最近播放 */
.recent {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.recent__label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--ink-faint);
}

.recent__list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.recent__list li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    font-size: 12.5px;
    color: var(--ink-soft);
    background: #f4f7f5;
    border-radius: 999px;
}

.recent__time {
    font-size: 11px;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

/* ---------------- 页脚 ---------------- */
.footer {
    margin-top: 30px;
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-faint);
}

.footer p { margin: 3px 0; }

.footer__meta { opacity: .85; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 880px) {
    .page { padding-top: 22px; }
    .grid { grid-template-columns: 1fr; }
    .card--queue { position: static; }
    .queue { max-height: none; }
}

@media (max-width: 560px) {
    .page { width: calc(100% - 22px); }
    .card { padding: 18px 16px 20px; }
    .form { grid-template-columns: 1fr; }
    .masthead { gap: 12px; }
    .masthead__mark { width: 42px; height: 42px; font-size: 21px; }
    .channel { font-size: 12px; padding: 6px 12px; }
    .btn { width: 100%; }
    .form__foot { flex-direction: column; align-items: stretch; }
    .form__tip { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ===========================================================
   查询码 / 查询页
   =========================================================== */

.toplinks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.toplink {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: color .15s, border-color .15s;
}

.toplink:hover {
    color: var(--teal);
    border-color: rgba(30, 111, 104, .36);
}

/* 点歌成功卡片 */
.ticket {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(207, 127, 60, .34);
    border-radius: var(--radius);
    background: linear-gradient(120deg, #fdf5ea, #fffdf9 62%);
    box-shadow: 0 10px 26px rgba(207, 127, 60, .1);
}

.ticket__label {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #8a4a2b;
}

.ticket__code {
    margin: 2px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .16em;
    color: #8a4a2b;
    font-variant-numeric: tabular-nums;
}

.ticket__song {
    margin: 0;
    font-size: 14px;
    color: var(--ink);
}

.ticket__hint {
    margin: 6px 0 0;
    font-size: 12.5px;
    color: var(--ink-soft);
}

.ticket__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag--status {
    margin-left: 8px;
    color: #14624f;
    background: #e3f3ea;
}

.btn--ghost {
    color: var(--ink-soft);
    background: #fff;
    border: 1px solid rgba(22, 50, 58, .16);
    box-shadow: none;
}

.btn--ghost:hover {
    color: var(--teal);
    border-color: rgba(30, 111, 104, .4);
}

/* 查询页 */
.page--narrow { width: min(620px, 100% - 32px); }

.masthead--compact { margin-bottom: 18px; }

.check-form {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.code-input {
    flex: 1;
    min-width: 0;
    padding: 13px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .3em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.check-error {
    margin: 14px 0 0;
    padding: 10px 13px;
    font-size: 13.5px;
    color: #8f2f28;
    background: #fbeae8;
    border: 1px solid rgba(143, 47, 40, .18);
    border-radius: 9px;
}

.result {
    margin-top: 18px;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-left: 5px solid var(--ink-faint);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result--is-pending { border-left-color: var(--orange); }
.result--is-approved { border-left-color: #2f8a63; }
.result--is-played { border-left-color: #7b8c93; }
.result--is-rejected { border-left-color: var(--red); }

.result__badge {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--teal-deep);
}

.result__desc {
    margin: 6px 0 0;
    font-size: 13.5px;
    color: var(--ink-soft);
}

.result__list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
}

.result__row {
    display: flex;
    gap: 12px;
    font-size: 13.5px;
}

.result__row dt {
    flex: none;
    width: 72px;
    color: var(--ink-faint);
}

.result__row dd {
    margin: 0;
    color: var(--ink);
    word-break: break-word;
}

.result__artist { color: var(--ink-soft); }

.result__code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    letter-spacing: .14em;
    color: #8a4a2b;
}

.callout {
    margin-top: 18px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, .76);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.callout__title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--teal-deep);
}

.callout__text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--ink-soft);
}

@media (max-width: 560px) {
    .ticket { flex-direction: column; align-items: stretch; padding: 18px; }
    .ticket__code { font-size: 32px; }
    .ticket__actions .btn { flex: 1; }
    .check-form { flex-direction: column; }
    .check-form .btn { width: 100%; }
}
