/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #dc2626;
    --primary-dark: #b91c1c;
    --secondary-color: #ea580c;
    --success-color: #10b981;
    --bg-color: #f9fafb;
    --card-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mobile-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--card-bg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* ===== 顶部栏 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: var(--shadow-md);
}

.header-gradient {
    padding: 20px;
    color: white;
}

.title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-id {
    font-size: 13px;
    opacity: 0.9;
}

/* ===== 主内容区 ===== */
.main-content {
    padding: 20px;
}

/* ===== 配额卡片 ===== */
.quota-card {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.quota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #92400e;
    font-weight: 600;
}

.quota-count {
    font-size: 16px;
    font-weight: 700;
}

.quota-count.warning {
    color: var(--primary-color);
}

.progress-bar {
    height: 8px;
    background: rgba(146, 64, 14, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 999px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ===== 区块标题 ===== */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== 消息输入区 ===== */
.message-section {
    margin-bottom: 32px;
}

.message-input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.message-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    margin-bottom: 16px;
}

.send-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== 投票区 ===== */
.vote-section {
    margin-bottom: 32px;
}

.vote-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.vote-btn {
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vote-btn:hover {
    border-color: var(--primary-color);
    background: #fef2f2;
    transform: translateY(-2px);
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.vote-btn.voted {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    box-shadow: var(--shadow-sm);
}

.vote-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.vote-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.vote-info {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== 统计卡片 ===== */
.stats-card {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-radius: 16px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-item svg {
    color: #7c3aed;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: #5b21b6;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #6d28d9;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(17, 24, 39, 0.95);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.toast.error {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

/* ===== 响应式设计 ===== */
@media (max-width: 600px) {
    .mobile-container {
        box-shadow: none;
    }
}

/* ===== 动画 ===== */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}