:root {
    /* 温暖学术主题色 */
    --primary: #A4161A;         
    --primary-hover: #8B1216;
    --primary-light: #FFF1F2;
    --secondary: #2C3E50;       
    --accent: #D4A853;         
    --info: #2874A6;            
    --info-light: #EBF5FB;
    --success: #1E8449;        
    --success-light: #E8F8F0;
    --warning: #B8860B;         
    --warning-light: #FFF8E7;
    --danger: #C0392B;         
    --danger-light: #FDEDEC;
    /* 表面色 */
    --bg: #F5F1EB;             
    --bg-card: #FFFFFF;
    --text: #2D2B28;            
    --text-secondary: #6B6560; 
    --text-muted: #A09890;
    --border: #E6DFD3;         
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 8px -2px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 16px -4px rgba(0,0,0,0.08), 0 4px 8px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 16px 24px -8px rgba(0,0,0,0.1), 0 6px 12px -6px rgba(0,0,0,0.04);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 20px;
    --transition: 0.2s ease;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: linear-gradient(180deg, #F5F1EB 0%, #EDE7DD 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- App Container --- */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========================================
   Header
   ======================================== */
.app-header {
    background: #1C1917;
    color: #FAF7F2;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    border-bottom: 3px solid var(--primary);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    line-height: 1;
}

.logo-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.logo-subtitle {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 深色头部中的按钮适配 */
.header-actions .btn-outline {
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.2);
}

.header-actions .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.4);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.12);
}

.user-badge:hover { background: rgba(255,255,255,0.18); }

.user-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-name { font-weight: 500; }

/* ========================================
   Tab Navigation
   ======================================== */
.tab-nav {
    display: flex;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 72px;
    z-index: 99;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 1;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20%;
    width: 60%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-btn.active::after { transform: scaleX(1); }

.tab-btn:hover { color: var(--primary); background: var(--primary-light); }

.tab-icon { font-size: 1.3rem; }
.tab-label { font-size: 0.8rem; }

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    padding: 24px;
}

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Panel Grid
   ======================================== */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    opacity: 0.5;
}

/* 不同模块的卡片标题装饰色 */
.card-checkin .card-header::before,
.card-stats .card-header::before { background: var(--primary); }   /* 签到 — 朱红 */

.card-message .card-header::before,
.card-message-list .card-header::before { background: var(--info); }  /* 留言 — 知性蓝 */

.card-poll-create .card-header::before,
.card-poll-list .card-header::before { background: var(--success); }  /* 投票 — 森林绿 */

.card-picker-display .card-header::before,
.card-picker-manage .card-header::before { background: var(--accent); }  /* 点名 — 暖金 */

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body { padding: 24px; }

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font-sans);
    white-space: nowrap;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 0 4px rgba(164,22,26,0.2);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #196F3D;
    box-shadow: 0 0 0 4px rgba(30,132,73,0.2);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #A93226;
    box-shadow: 0 0 0 4px rgba(192,57,43,0.2);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; font-weight: 600; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-icon { padding: 6px 10px; min-width: 36px; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* ========================================
   Form Elements
   ======================================== */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.input, .textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-card);
    transition: var(--transition);
    outline: none;
}

.input:focus, .textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(164,22,26,0.1);
}

.textarea { resize: vertical; min-height: 70px; }

/* ========================================
   Badge
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-live {
    background: var(--success-light);
    color: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========================================
   Toast
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease, fadeOutRight 0.3s ease 2.5s forwards;
    max-width: 350px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--secondary); }
.toast-warning { background: var(--warning); color: white; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 420px;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1.1rem; }

.modal-body { padding: 24px; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.modal-close:hover { background: var(--bg); }

/* ========================================
   课堂签到系统
   ======================================== */
.card-checkin { grid-column: 1; }
.card-stats { grid-column: 2; }

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius);
}

.qr-container {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    overflow: hidden;
}

.qr-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.qr-placeholder .qr-icon { font-size: 3rem; display: block; margin-bottom: 8px; }

.qr-info { text-align: center; }

.session-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.session-code .label { color: var(--text-secondary); font-size: 0.9rem; }
.session-code .code {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.qr-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.checkin-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.quick-checkin-form {
    display: flex;
    gap: 8px;
}

.quick-checkin-form .input { flex: 1; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 16px 8px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

/* 三个统计项不同强调色，避免单调 */
.stat-item:nth-child(1) .stat-value { color: var(--primary); }     /* 签到人数 — 朱红 */
.stat-item:nth-child(2) .stat-value { color: var(--info); }        /* 签到率 — 知性蓝 */
.stat-item:nth-child(3) .stat-value { color: var(--success); }     /* 场次 — 森林绿 */

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.checkin-list {
    max-height: 300px;
    overflow-y: auto;
}

.checkin-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.checkin-item:last-child { border-bottom: none; }

.checkin-item .name { font-weight: 500; }
.checkin-item .time { font-size: 0.8rem; color: var(--text-muted); }
.checkin-item .method {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--primary-light);
    color: var(--primary);
}

/* ========================================
   留言弹幕系统
   ======================================== */
.danmaku-stage {
    position: relative;
    width: 100%;
    height: 200px;
    background: 
        linear-gradient(135deg, rgba(26,26,31,0.75) 0%, rgba(28,28,36,0.7) 40%, rgba(30,35,48,0.75) 100%),
        url('../images/bg.jpg') center/cover no-repeat;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    border: 2px solid #2a2a35;
}

.danmaku-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.danmaku-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 1.1rem;
    z-index: 1;
}

.danmaku-placeholder span { font-size: 2.5rem; }

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    animation: danmakuScroll linear forwards;
    z-index: 2;
    pointer-events: none;
}

@keyframes danmakuScroll {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

.card-message { grid-column: 1; }
.card-message-list { grid-column: 2; }

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.message-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.color-picker {
    display: flex;
    gap: 8px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.color-dot:hover { transform: scale(1.2); }
.color-dot.active { border-color: var(--text); transform: scale(1.15); box-shadow: 0 0 0 3px rgba(0,0,0,0.1); }

.message-list {
    max-height: 350px;
    overflow-y: auto;
}

.message-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.message-item:last-child { border-bottom: none; }

.message-item .msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.message-item .msg-content { flex: 1; min-width: 0; }
.message-item .msg-author { font-weight: 600; font-size: 0.9rem; }
.message-item .msg-text { font-size: 0.9rem; color: var(--text-secondary); word-break: break-all; }
.message-item .msg-time { font-size: 0.75rem; color: var(--text-muted); }

/* ========================================
   投票问卷系统
   ======================================== */
.card-poll-create { grid-column: 1; }
.card-poll-list { grid-column: 2; }

.options-list { margin-bottom: 10px; }

.option-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.option-row .input { flex: 1; }

.btn-remove-option {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-remove-option:hover {
    background: var(--danger-light);
}

.poll-item {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.poll-item .poll-question {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.poll-option {
    margin-bottom: 8px;
}

.poll-option-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    background: white;
}

.poll-option-bar:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.poll-option-bar.voted {
    border-color: var(--primary);
    cursor: default;
}

.poll-option-bar .bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(164,22,26,0.12);
    border-radius: var(--radius-sm);
    transition: width 0.6s ease;
    z-index: 0;
}

.poll-option-bar .bar-text {
    position: relative;
    z-index: 1;
    flex: 1;
    font-size: 0.85rem;
}

.poll-option-bar .bar-count {
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
}

.poll-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   随机点名系统
   ======================================== */
.card-picker-display { grid-column: 1; }
.card-picker-manage { grid-column: 2; }

.picker-screen {
    background: linear-gradient(135deg, #1a1a24 0%, #232336 50%, #1e2844 100%);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 20px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2px solid #2a2a3a;
}

.picker-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1;
    transition: all 0.1s ease;
}

.picker-name.picking {
    animation: nameShuffle 0.08s infinite;
}

@keyframes nameShuffle {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.picker-name.selected {
    color: #FCD34D;
    font-size: 3rem;
    animation: selectedPop 0.5s ease;
}

@keyframes selectedPop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.picker-animation {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotateBg 3s linear infinite;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.picker-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.picker-actions .btn { flex: 1; }

.result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--success-light);
    border-radius: var(--radius);
    animation: fadeIn 0.3s ease;
    border: 1px solid #C8E6C9;
}

.result-emoji { font-size: 2rem; }
.result-name { font-weight: 700; font-size: 1.2rem; color: var(--success); }
.result-time { font-size: 0.8rem; color: var(--text-muted); margin-left: auto; }

.name-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.name-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
}

.picker-history { margin-top: 20px; }

.picker-history h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.history-list { margin-bottom: 10px; }

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.history-item .h-name { font-weight: 500; }
.history-item .h-time { color: var(--text-muted); font-size: 0.75rem; }

/* ========================================
   Empty State
   ======================================== */
.empty-hint {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 0;
    font-size: 0.9rem;
}

/* ========================================
   Footer
   ======================================== */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .header-inner {
        padding: 10px 16px;
    }

    .logo-title { font-size: 1.1rem; }
    .logo-subtitle { font-size: 0.7rem; }
    .logo-icon { font-size: 1.5rem; }

    .tab-nav {
        position: sticky;
        top: 56px;
    }

    .tab-btn {
        padding: 10px 12px;
        min-width: 70px;
    }

    .tab-icon { font-size: 1.1rem; }
    .tab-label { font-size: 0.7rem; }

    .main-content { padding: 16px; }

    .panel-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-checkin, .card-stats,
    .card-message, .card-message-list,
    .card-poll-create, .card-poll-list,
    .card-picker-display, .card-picker-manage {
        grid-column: 1;
    }

    .checkin-actions {
        flex-direction: column;
    }

    .quick-checkin-form {
        flex-direction: column;
    }

    .message-actions {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .color-picker { justify-content: center; }

    .qr-container {
        width: 160px;
        height: 160px;
    }

    .picker-name {
        font-size: 1.8rem;
    }

    .picker-name.selected {
        font-size: 2.2rem;
    }

    .picker-actions {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-value { font-size: 1.4rem; }

    .toast-container {
        left: 16px;
        right: 16px;
        top: 10px;
    }

    .toast { max-width: 100%; }
}

@media (max-width: 480px) {
    .header-inner { flex-direction: column; gap: 8px; text-align: center; }
    .logo-area { flex-direction: column; }
    .tab-nav { top: 90px; }
    .tab-btn { flex-direction: row; gap: 4px; padding: 8px 10px; }
    .tab-icon { font-size: 1rem; }
}
