/* ============================================================
   APK 使用记录上报系统 - 样式表
   设计理念：现代简约，清晰专业
   ============================================================ */

/* === 基础变量 === */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fef2f2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --transition: 0.2s ease;
}

/* === 全局重置 === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    padding: 24px 20px 48px;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* === 导航栏 === */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    text-decoration: none;
}
.nav-brand:hover {
    color: var(--primary);
    text-decoration: none;
}
.nav-brand svg {
    color: var(--primary);
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-link {
    font-size: 14px;
    color: var(--gray-600);
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: all var(--transition);
    text-decoration: none;
}
.nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    text-decoration: none;
}
.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--gray-200);
}
.nav-username {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}

/* === 按钮 === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: #fff;
    color: var(--gray-700);
    border-color: var(--gray-300);
}
.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-danger {
    background: #fff;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}
.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
}
.btn-block {
    width: 100%;
}

.btn-add-time {
    margin-top: 8px;
}

/* === 认证页面 === */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
}
.auth-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}
.auth-header p {
    font-size: 14px;
    color: var(--gray-500);
}
.auth-form .form-group {
    margin-bottom: 20px;
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-500);
}

/* === 表单 === */
.form-group {
    margin-bottom: 16px;
}
.modal .form-group {
    margin-bottom: 12px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.modal .form-group label {
    font-size: 13px;
    margin-bottom: 5px;
}
.modal .form-group input[type="text"],
.modal .form-group input[type="date"],
.modal .form-group select {
    padding: 8px 10px;
    font-size: 13px;
}
.required {
    color: var(--danger);
}
.label-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--gray-400);
    margin-left: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    pointer-events: none;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input-wrapper input {
    padding-left: 38px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
input::placeholder {
    color: var(--gray-400);
}

.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group {
    flex: 1;
}

.form-message {
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 12px;
    display: none;
}
.form-message.success {
    display: block;
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.form-message.error {
    display: block;
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}
.form-message.warning {
    display: block;
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fed7aa;
}

/* === Flash 消息 === */
.flash-messages {
    margin-bottom: 16px;
}
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 8px;
    animation: slideDown 0.3s ease;
}
.flash-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fed7aa; }
.flash-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.flash-error   { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
.flash-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === 仪表盘 === */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- 欢迎横幅 --- */
.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    padding: 20px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}
.welcome-text h2 {
    font-size: 20px;
    margin-bottom: 4px;
}
.welcome-text p {
    font-size: 13px;
    opacity: 0.85;
}
.welcome-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.btn-outline-light {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-outline-light:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.75);
}
.btn-outline-light.active {
    background: rgba(255,255,255,0.28);
    border-color: #fff;
}

/* --- 统计卡片 --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: box-shadow var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
}
.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.stat-label {
    font-size: 14px;
    color: var(--gray-500);
}

/* --- 卡片 --- */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}
.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}
.badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 99px;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* --- 计划卡片网格 --- */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    padding: 16px 24px 24px;
}
.plan-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}
.plan-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}
.plan-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}
.plan-app-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.plan-app-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}
.plan-app-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
}
.plan-pkg {
    font-size: 12px;
    color: var(--gray-400);
    font-family: "SF Mono", "Consolas", monospace;
}
.plan-date {
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
}
.plan-time-ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.time-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 99px;
    color: var(--gray-600);
}
.time-chip svg {
    color: var(--gray-400);
}
.plan-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* --- 空状态 --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.empty-state p {
    font-size: 15px;
    color: var(--gray-500);
    margin: 16px 0;
}
.empty-hint {
    font-size: 13px !important;
    color: var(--gray-400) !important;
    margin-top: 4px !important;
}

/* === 模态框 === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.show {
    display: flex;
}
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}
.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color var(--transition);
}
.modal-close:hover {
    color: var(--gray-600);
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--gray-200);
}

/* --- 时间段输入 --- */
.time-range-empty {
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-400);
    font-size: 13px;
    text-align: center;
}
.time-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 8px;
    animation: slideDown 0.2s ease;
}
.time-range-index {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    min-width: 24px;
}
.time-range-sep {
    font-size: 13px;
    color: var(--gray-400);
}
.time-input {
    width: auto !important;
    flex: 1;
    max-width: 140px;
}
.btn-remove-time {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-400);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}
.btn-remove-time:hover {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* === 上报日志页 === */
.report-log-list {
    padding: 8px 0;
}
.report-log-item {
    border-bottom: 1px solid var(--gray-100);
}
.report-log-item:last-child {
    border-bottom: none;
}
.report-log-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    cursor: default;
    transition: background var(--transition);
}
.report-log-header:hover {
    background: var(--gray-50);
}
.report-log-minute {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    font-family: "SF Mono", "Consolas", monospace;
    min-width: 120px;
}
.report-log-device {
    font-size: 13px;
    color: var(--gray-500);
    font-family: "SF Mono", "Consolas", monospace;
}
.report-log-time {
    font-size: 12px;
    color: var(--gray-400);
    margin-left: auto;
}
.report-log-detail {
    padding: 0 24px 16px;
    animation: slideDown 0.2s ease;
}
.json-preview {
    background: #1e1e2e;
    color: #a6adc8;
    border-radius: var(--radius);
    padding: 16px;
    font-size: 13px;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.5;
}

.api-response-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--gray-700);
    word-break: break-all;
}

/* === Admin 样式 === */
.badge-admin {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
}

.badge-info {
    background: var(--blue-100, #dbeafe);
    color: var(--primary-dark, #1d4ed8);
    font-size: 12px;
    padding: 2px 10px;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 16px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--gray-50);
}

.table th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}

.table td code {
    font-size: 12px;
    background: var(--gray-50);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gray-700);
}

.table tbody tr:hover {
    background: var(--primary-light, #f0f4ff);
}

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-warning-outline {
    background: transparent;
    border: 1px solid var(--warning, #f59e0b);
    color: var(--warning, #f59e0b);
}

.btn-warning-outline:hover {
    background: var(--warning, #f59e0b);
    color: #fff;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger);
    color: #fff;
}

.btn-info-outline {
    background: transparent;
    border: 1px solid #6366f1;
    color: #6366f1;
}
.btn-info-outline:hover {
    background: #6366f1;
    color: #fff;
}

/* ===== 公告弹窗 ===== */
.announcement-dialog {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 480px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.25s ease;
}
.announcement-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 22px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}
.announcement-header svg {
    flex-shrink: 0;
}
.announcement-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.announcement-close:hover { color: #374151; }
.announcement-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}
.announcement-item {
    padding: 4px 0;
}
.announcement-item-divider {
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 14px;
    padding-bottom: 14px;
}
.announcement-text {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    white-space: pre-line;
}
.announcement-time {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}
.announcement-footer {
    padding: 14px 22px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
}

/* ===== 公告管理面板 ===== */
.announcement-admin-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.announcement-admin-card .card-header h3 {
    display: flex;
    align-items: center;
    gap: 6px;
}
.announcement-list {
    padding: 0;
}
.announcement-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
}
.announcement-row:last-child { border-bottom: none; }
.announcement-row.announcement-inactive {
    opacity: 0.5;
}
.announcement-row-content { flex: 1; min-width: 0; }
.announcement-row-text {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.6;
    white-space: pre-line;
}
.announcement-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}
.announcement-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .announcement-dialog {
        max-width: 95vw;
        max-height: 85vh;
        border-radius: 12px;
    }
    .announcement-header {
        padding: 14px 16px;
        font-size: 15px;
    }
    .announcement-body {
        padding: 16px;
    }
    .announcement-footer {
        padding: 12px 16px;
    }
    .announcement-row {
        flex-direction: column;
    }
    .announcement-row-actions {
        align-self: flex-end;
    }
}
/* ===== 公告样式结束 ===== */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.admin-switch-bar {
    margin-bottom: 20px;
    padding: 16px 20px;
}

.admin-switch-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-switch-label {
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.admin-user-select {
    width: auto;
    min-width: 280px;
    max-width: 400px;
    padding: 8px 12px !important;
}

.report-log-user {
    font-weight: 600;
    color: var(--primary-dark, #1d4ed8);
    font-size: 13px;
    min-width: 60px;
}

/* === 每日计划复选框 === */
.form-group-checkbox {
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-text {
    user-select: none;
}

/* === 每日计划徽章 === */
.badge-daily {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    line-height: 1.4;
}

/* === 响应式 === */
@media (max-width: 768px) {
    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .welcome-banner h2 {
        font-size: 20px;
    }
    .welcome-banner p {
        font-size: 13px;
    }
    .welcome-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .btn-outline-light {
        font-size: 12px;
        padding: 7px 14px;
    }
    .stats-row {
        grid-template-columns: 1fr;
    }
    .plan-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        flex-direction: column;
    }
    .auth-card {
        padding: 24px;
    }
    .nav-links {
        gap: 4px;
        flex-wrap: wrap;
    }
    .nav-link {
        font-size: 12px;
        padding: 4px 8px;
        white-space: nowrap;
    }
    .nav-user-menu {
        gap: 6px;
        margin-left: 4px;
        padding-left: 8px;
    }
    .nav-username {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 12px;
    }
    .nav-user-menu .btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* 导航栏移动端优化 */
    .nav-inner {
        flex-wrap: wrap;
        gap: 8px;
        height: auto;
        min-height: 52px;
        padding: 8px 0;
    }
    .nav-brand {
        font-size: 15px;
        gap: 6px;
    }
    .report-log-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Admin 切换栏移动端 */
    .admin-switch-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .admin-switch-label {
        font-size: 13px;
    }
    .admin-user-select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 10px 12px !important;
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .admin-view-badge {
        align-self: flex-start;
        font-size: 12px;
    }

    /* 模态框移动端全屏 */
    .modal {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 20px 16px;
    }
    .modal-footer {
        padding: 16px;
        border-top: 1px solid var(--gray-200);
        background: var(--gray-50);
    }

    /* 输入框更大触控区 */
    .form-group input[type="text"],
    .form-group input[type="date"],
    .form-group select,
    .time-trigger {
        height: 44px;
        font-size: 16px;
    }
    input, select, textarea, button {
        font-size: 16px !important; /* 防止 iOS 缩放 */
    }

    /* 时间选择行优化 */
    .time-range-row {
        flex-wrap: nowrap;
        gap: 6px;
    }
    .time-range-index {
        font-size: 13px;
        min-width: 28px;
    }
    .time-range-sep {
        font-size: 13px;
        padding: 0 2px;
    }
    .btn-remove-time {
        width: 36px;
        height: 36px;
    }

    /* 计划卡片操作 */
    .plan-card-actions {
        flex-direction: row;
        gap: 8px;
    }
    .plan-card-actions .btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }

    /* 欢迎按钮 */
    .welcome-banner .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 小屏幕进一步优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    .navbar {
        padding: 6px 0;
    }
    .nav-inner {
        gap: 6px;
    }
    .nav-brand {
        font-size: 14px;
    }
    .nav-link {
        font-size: 11px;
        padding: 3px 6px;
    }
    .nav-user-menu {
        gap: 4px;
        padding-left: 6px;
        margin-left: 2px;
    }
    .nav-username {
        max-width: 60px;
        font-size: 11px;
    }
    .nav-user-menu .btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    .badge {
        font-size: 10px;
        padding: 2px 5px;
    }
    .plan-app-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .plan-app-name {
        font-size: 15px;
    }
    .stat-card {
        padding: 14px;
    }
    .stat-value {
        font-size: 22px;
    }
    .stat-label {
        font-size: 12px;
    }
    /* 时间触发器缩小 */
    .time-trigger {
        min-width: 52px;
        padding: 8px 10px;
        font-size: 13px;
    }
    .time-range-index {
        font-size: 11px;
        min-width: 20px;
    }
}

/* ===== 订阅管理页面附加样式 ===== */
.sub-item-card {
    transition: box-shadow 0.15s, border-color 0.15s;
}
.sub-item-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-color: #bebef8;
}

.sub-card-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 8px;
}
.sub-card-status.active {
    background: #d1fae5;
    color: #065f46;
}
.sub-card-status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* 订阅计划表格 (admin) */
.plans-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.plans-table th {
    background: #f9fafb;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}
.plans-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}
.plans-table .time-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #ede9fe;
    color: #6d28d9;
    border-radius: 4px;
    margin: 2px 3px;
    font-size: 12px;
}
.plans-table .no-data {
    text-align: center;
    color: #9ca3af;
    padding: 20px;
}
.plans-table .act-btns {
    display: flex;
    gap: 4px;
}

/* 小按钮 */
.btn-tiny {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}
.btn-tiny.btn-outline {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}
.btn-tiny.btn-outline:hover { background: #f9fafb; }
.btn-tiny.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.btn-tiny.btn-danger:hover { background: #fecaca; }

/* 分类标签 */
.cat-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.cat-tab {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.15s;
}
.cat-tab.selected {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

/* === 订阅提示 Toast === */
.sub-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 420px;
    width: 90%;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.35);
    font-size: 14px;
    line-height: 1.6;
    animation: toastIn 0.35s ease, toastOut 0.35s ease 3s forwards;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.sub-toast-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.sub-toast-text { flex: 1; }
.sub-toast-text strong { font-size: 15px; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* === 帮助提示 === */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
    position: relative;
    margin-left: 4px;
    transition: background 0.2s;
}
.help-tip:hover { background: rgba(255,255,255,0.35); }
.help-tip .help-popup {
    display: none;
    position: absolute;
    top: 30px;
    right: -10px;
    width: 280px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.7;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 100;
    text-align: left;
}
.help-tip:hover .help-popup { display: block; }
.help-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 2px;
}

/* === 订阅横幅 === */
.sub-banner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
    border: 2px solid #c7d2fe;
    border-radius: 14px;
    padding: 18px 22px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}
.sub-banner::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 50%;
}
.sub-banner-icon { font-size: 32px; flex-shrink: 0; margin-top: 4px; }
.sub-banner-content { flex: 1; min-width: 0; }
.sub-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: #3730a3;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.sub-banner-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.sub-banner-btn:hover { background: rgba(79, 70, 229, 0.2); }
.sub-banner-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.sub-banner-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
}
.sub-banner-name { font-weight: 600; color: #1e1b4b; }
.sub-banner-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e0e7ff;
    color: #4f46e5;
    font-weight: 600;
    white-space: nowrap;
}
.sub-banner-badge.ai {
    background: linear-gradient(135deg, #d8b4fe, #c4b5fd);
    color: #6d28d9;
}
.sub-banner-tip {
    font-size: 12px;
    color: #6366f1;
    line-height: 1.6;
}
