body { background: var(--paper); }
.login-wrap { max-width: 420px; margin: 0 auto; padding: 40px 16px; }
.login-wrap .card { background: #fff; border-radius: 16px; padding: 20px 16px; margin-top: 16px; }
.card { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; }

.atop { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 8px 4px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.atop .title { font-weight: 800; color: var(--ink); font-size: 18px; white-space: nowrap; }
.atop .who { flex: 1; min-width: 0; text-align: right; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.langseg { display: inline-flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; }
.langseg button { min-width: 44px; min-height: 44px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-weight: 800; color: var(--muted); cursor: pointer; }
.langseg button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }

.amenu { position: sticky; top: 52px; z-index: 39; display: flex; gap: 2px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 6px; -webkit-overflow-scrolling: touch; }
.amenu button { position: relative; flex: none; min-height: 48px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.amenu button[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }

.acontent { padding: 12px; max-width: 980px; margin: 0 auto; }
.acontent.wide { max-width: none; padding: 0; }

.split { display: block; }
.pane { background: transparent; }
.pane-list { padding: 10px 12px; }
.pane-thread { padding: 10px 12px 40px; }
.split.thread-open .pane-list { display: none; }
.split:not(.thread-open) .pane-thread { display: none; }
@media (min-width: 900px) {
  .split { display: grid; grid-template-columns: minmax(320px, 380px) 1fr; height: calc(100vh - 101px); }
  .pane { overflow: auto; }
  .pane-list { border-right: 1px solid var(--line); background: #fff; }
  .split.thread-open .pane-list, .split:not(.thread-open) .pane-thread { display: block; }
  .pane-thread .back-btn { display: none; }
}

.fseg { display: flex; background: var(--gray-soft); border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.fseg button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.fseg button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.filters { display: grid; grid-template-columns: 1fr 96px; gap: 8px; margin-bottom: 8px; }
.filters .full { grid-column: 1 / -1; }

.aq { position: relative; display: block; padding: 10px 12px 10px 22px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: inherit; text-decoration: none; }
.aq:active { background: var(--accent-soft); }
.aq.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(168, 92, 22, .18); }
.aq.unread { background: #FFF6E9; border-color: #EBCBA6; }
.aq .dot { position: absolute; left: 8px; top: 17px; }
.aq .l1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aq .l1 .time { margin-left: auto; font-size: 14px; color: var(--muted); }
.aq .l2 { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; align-items: center; }
.aq .prev { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); font-size: 16px; }
.aq.unread .prev { font-weight: 700; }

.thead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.thead select { width: auto; min-width: 130px; }
.thead .grow { min-width: 140px; }

.mcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.mcard.student { border-left: 5px solid var(--accent-2, #D6883A); }
.mcard.admin { border-left: 5px solid var(--blue); }
.mhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.mhead .time { margin-left: auto; color: var(--muted); font-size: 14px; }
.cols { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) and (max-width: 899px), (min-width: 1100px) {
  .cols { grid-template-columns: 1fr 1fr; }
}
.col { background: var(--paper); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.col.tr { background: #F1F6FA; }
.col .lab { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.col .txt { white-space: pre-wrap; color: var(--ink); font-size: 16px; line-height: 1.65; }
.col .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.col textarea { min-height: 96px; }

.reply { border: 2px solid var(--accent); }
.reply h3 { margin-bottom: 8px; }
.prevbox { margin-top: 12px; padding: 12px; border-radius: 12px; background: #F1F6FA; }
.prevbox .back { padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px dashed var(--line-strong); white-space: pre-wrap; color: var(--ink); margin-bottom: 10px; }
.stale { color: #8A5A00; font-size: 15px; margin-top: 8px; }

.rowitem { display: flex; gap: 8px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rowitem:last-child { border-bottom: 0; }
.rowitem .body { flex: 1; min-width: 0; }
.rowitem .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.usage-bar { height: 12px; border-radius: 6px; background: var(--gray-soft); overflow: hidden; margin: 6px 0; }
.usage-bar > i { display: block; height: 100%; background: var(--green); }
.usage-bar.warn > i { background: #E0A100; }
.usage-bar.full > i { background: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.mcard .vid-wrap { width: 480px; }
.login-wrap a[href] { display: inline-flex; align-items: center; min-height: 44px; }
