/* 筹码识别系统 - 玻璃拟态风格样式文件 */

/* CSS 变量 */
:root {
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* 玻璃拟态配色 */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --card-gradient: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-light: #64748b;
    
    --radius: 16px;
    --radius-lg: 24px;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 2rem 1rem;
}

/* 装饰性背景圆 */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* 容器 */
.container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 头部 */
header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 400;
}

/* 玻璃卡片通用样式 */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

/* 上传区域 */
.upload-section {
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.01);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.upload-icon {
    color: white;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.upload-icon svg {
    filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.5));
}

.upload-text {
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.5rem;
}

.browse-link {
    color: #fcd34d;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.browse-link:hover {
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(252, 211, 77, 0.5);
}

.upload-hint {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* 设置 */
.settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.settings label {
    font-weight: 500;
    color: white;
}

.settings input[type="range"] {
    width: 200px;
    height: 6px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
}

.settings input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.settings input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.6);
}

#confValue {
    font-weight: 700;
    color: #fcd34d;
    min-width: 30px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 按钮 */
.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #7c3aed;
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
    background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary.loading {
    pointer-events: none;
}

.btn-loading {
    display: none;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loading {
    display: inline;
    animation: pulse 1s infinite;
}

/* 预览区域 */
.preview-section {
    padding: 2rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease;
}

.preview-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
}

.result-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 图片预览 */
.image-preview {
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
}

/* 统计卡片 */
.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.75) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.stat-card.total-value {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #c084fc 100%);
    color: white;
    border: none;
}

.stat-card.chip-count {
    background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
    color: white;
    border: none;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 筹码详情 */
.chips-detail {
    background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.7) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.chips-detail h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.chips-detail ul {
    list-style: none;
}

.chips-detail li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.chips-detail li:hover {
    transform: translateX(6px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chip-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chip-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.chip-name {
    font-weight: 600;
    color: var(--text-primary);
}

.chip-value {
    font-weight: 700;
    color: #8b5cf6;
    font-size: 1.1rem;
}

.chip-confidence {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-left: 0.25rem;
}

/* 状态提示 */
.status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    display: none;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.status.success {
    display: block;
    background: rgba(16, 185, 129, 0.25);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.status.error {
    display: block;
    background: rgba(239, 68, 68, 0.25);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.status.loading {
    display: block;
    background: rgba(139, 92, 246, 0.25);
    color: #6d28d9;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    animation: fadeIn 0.8s ease 0.5s both;
}

footer p {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* 响应式 */
@media (max-width: 640px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .upload-section,
    .preview-section {
        padding: 1.5rem;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
    }
    
    .settings {
        flex-wrap: wrap;
    }
    
    .settings input[type="range"] {
        width: 150px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}
