/* AirScan QR - 样式文件 */
/* 替换 TailwindCSS CDN，使用原生 CSS */

:root {
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-100: #dbeafe;
    --blue-50: #eff6ff;
    --indigo-600: #4f46e5;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-700: #b91c1c;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-200: #fecaca;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --slate-300: #cbd5e1;
    --slate-500: #64748b;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
    background-color: var(--gray-50);
    min-height: 100vh;
    color: var(--slate-900);
    padding-bottom: 5rem;
}

/* 布局容器 */
.container {
    max-width: 36rem;
    margin: 0 auto;
    padding: 2rem 1rem 0;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--slate-800);
    letter-spacing: -0.05em;
}

/* Tab 切换 */
.tab-container {
    background: var(--gray-200);
    padding: 0.25rem;
    border-radius: 1rem;
    display: flex;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.tab-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    background: transparent;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: var(--blue-600);
}

/* 面板卡片 */
.panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel.hidden {
    display: none;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-100);
}

.card-lg {
    padding: 1.5rem;
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--gray-50);
}

/* 输入区域 */
.input-wrapper {
    position: relative;
}

.textarea {
    width: 100%;
    padding: 1.25rem;
    background: var(--gray-50);
    border: 2px dashed var(--gray-200);
    border-radius: 1rem;
    height: 8rem;
    outline: none;
    font-size: 0.875rem;
    resize: none;
}

.textarea:focus {
    border-color: var(--blue-500);
}

/* 文件卡片覆盖层 */
.file-overlay {
    position: absolute;
    inset: 0;
    background: white;
    border: 2px solid var(--blue-50);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 1rem;
}

/* 设置区域 */
.settings {
    margin-top: 1rem;
    padding: 0 0.5rem;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.setting-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--slate-500);
}

.setting-value {
    font-family: monospace;
}

.range-input {
    width: 50%;
    -webkit-appearance: none;
    background: transparent;
}

.range-input::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
}

.range-input::-webkit-slider-thumb {
    height: 26px;
    width: 26px;
    border-radius: 50%;
    background: var(--blue-600);
    -webkit-appearance: none;
    margin-top: -9px;
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* 按钮网格 */
.btn-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 1rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.btn-gray {
    background: var(--gray-100);
    color: var(--slate-900);
}

.btn-blue {
    background: var(--blue-600);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
}

.btn-indigo {
    background: var(--indigo-600);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-full {
    grid-column: span 2;
}

.btn-small {
    padding: 0.75rem;
    font-size: 0.75rem;
}

/* 播放器 */
.player-box {
    text-align: center;
}

.frame-counter {
    font-size: 3rem;
    font-family: monospace;
    font-weight: 900;
    color: var(--slate-900);
    margin-bottom: 1.5rem;
}

.frame-current {
    color: var(--blue-600);
}

.frame-divider {
    color: var(--gray-200);
}

/* QR 画布 */
.qr-canvas-wrapper {
    display: flex;
    justify-content: center;
    padding: 1.25rem;
    background: white;
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

canvas#qr-canvas {
    width: 100% !important;
    max-width: 350px;
    height: auto !important;
}

/* 播放控制 */
.player-controls {
    margin-top: 2.5rem;
}

.slider-wrapper {
    margin-bottom: 2rem;
}

.control-btns {
    display: flex;
    gap: 1rem;
}

.ctrl-btn {
    width: 4rem;
    height: 4rem;
    background: var(--gray-100);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.ctrl-btn-main {
    flex: 1;
    background: var(--slate-900);
    color: white;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.875rem;
}

/* 接收端 */
.reader-container {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 1.5rem;
    background: var(--slate-900);
    overflow: hidden;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reader-placeholder {
    color: var(--slate-500);
    font-size: 0.75rem;
    font-style: italic;
}

/* 任务信息 */
.task-info {
    padding: 1rem;
    background: var(--blue-50);
    border-radius: 1rem;
    border: 1px solid var(--blue-100);
}

.task-label {
    font-size: 0.625rem;
    font-weight: 900;
    color: var(--blue-400);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.task-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e40af;
    word-break: break-all;
}

/* 进度统计 */
.stats-box {
    padding: 1.25rem;
    background: var(--red-50);
    border-radius: 1.5rem;
    border: 1px solid var(--red-100);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stats-label {
    font-size: 0.75rem;
    font-weight: 900;
    color: var(--red-400);
    text-transform: uppercase;
}

.stats-badge {
    background: var(--red-200);
    color: var(--red-700);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: monospace;
}

.missing-list {
    display: flex;
    flex-wrap: wrap;
    color: var(--slate-300);
    font-size: 0.75rem;
    font-style: italic;
}

/* 进度网格 */
.recv-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 1rem;
}

.dot {
    width: calc(10% - 5.4px);
    aspect-ratio: 1;
    border-radius: 4px;
    background: #f1f5f9;
    transition: all 0.2s;
}

.dot.received {
    background: var(--emerald-500);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

/* 缺失芯片 */
.missing-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 6px;
    background: #fff1f2;
    color: #e11d48;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    margin: 4px;
    border: 1px solid #ffe4e6;
    cursor: pointer;
}

/* 成功卡片 */
.success-card {
    background: var(--emerald-600);
    padding: 2rem;
    border-radius: 2.5rem;
    color: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.success-name {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 1.5rem;
    word-break: break-all;
}

.download-btn {
    width: 100%;
    padding: 1.25rem;
    background: white;
    color: var(--emerald-700);
    border-radius: 1rem;
    font-weight: 900;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
}

/* 工具类 */
.hidden {
    display: none !important;
}

.text-blue-600 {
    color: var(--blue-600);
}

.text-indigo-600 {
    color: var(--indigo-600);
}

.text-red-500 {
    color: var(--red-500);
}

.text-emerald-500 {
    color: var(--emerald-500);
}

.font-bold {
    font-weight: 700;
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.underline {
    text-decoration: underline;
}

.uppercase {
    text-transform: uppercase;
}

.break-all {
    word-break: break-all;
}
