/* 准某点数相机 - 样式表 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    color: white;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title {
    text-align: left;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* 用户信息区域 */
.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userInfo {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid white;
}

#userName {
    font-weight: bold;
    color: white;
}

.btn-subscription {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-subscription:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Google登录按钮区域 */
#loginSection {
    display: flex;
    align-items: center;
}

#google-signin-btn {
    /* Google按钮样式由Google SDK自动生成 */
}

/* 余额栏样式 */
.balance-bar {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.balance-info {
    font-size: 1.2em;
    color: #333;
}

.balance-amount {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    margin-left: 10px;
}

.refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* 文件上传样式 */
.file-upload {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 3px dashed #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9ff;
}

.file-upload-label:hover {
    background: #e8ebff;
    border-color: #5568d3;
}

.file-upload-label.has-file {
    border-color: #52c41a;
    background: #f6ffed;
}

.upload-text {
    text-align: center;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

/* 按钮样式 */
.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示样式 */
.error-message {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.success-message {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
}

/* Canvas区域样式 */
.canvas-container {
    position: relative;
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

#imageCanvas {
    display: block;
    max-width: 100%;
    cursor: crosshair;
}

/* Canvas工具栏 */
.canvas-tools {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.tool-btn.primary {
    background: #667eea;
    color: white;
}

.tool-btn.primary:hover {
    background: #5568d3;
}

.tool-btn.danger {
    background: #dc3545;
    color: white;
}

.tool-btn.danger:hover {
    background: #c82333;
}

.tool-btn.success {
    background: #28a745;
    color: white;
}

.tool-btn.success:hover {
    background: #218838;
}

.tool-btn.warning {
    background: #faad14;
    color: white;
}

.tool-btn.warning:hover {
    background: #d48806;
}

.tool-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 区域信息提示 */
.region-info {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.95em;
    color: #856404;
}

.region-info strong {
    color: #ff6b6b;
    font-size: 1.1em;
}

/* 统计卡片 */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* 结果列表 */
.result-list {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.result-item {
    background: #f6ffed;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #52c41a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.result-item:hover {
    background: #d9f7be;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.result-info {
    flex: 1;
}

.result-badge {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

/* 图例样式 */
.legend {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    margin-bottom: 5px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    margin-right: 5px;
    border: 2px solid #333;
}

/* 空状态样式 */
#emptyState {
    text-align: center;
    padding: 100px 20px;
    color: #999;
}

/* 通知动画 */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* 使用次数显示 */
.usage-display {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.usage-display.subscription {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.usage-display.free {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.usage-unlimited {
    display: flex;
    align-items: center;
    gap: 6px;
}

.usage-icon {
    font-size: 16px;
}

.usage-text {
    font-weight: 600;
}

.usage-free {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
}

.usage-label {
    color: #6c757d;
    font-size: 11px;
    font-weight: 400;
}

.usage-count {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: #2c3e50;
}

.usage-count .remaining {
    font-size: 20px;
    font-weight: 700;
}

.usage-count .separator {
    font-size: 14px;
    color: #adb5bd;
}

.usage-count .total {
    font-size: 14px;
    color: #6c757d;
}

.usage-free.low .usage-count .remaining {
    color: #ff9800;
}

.usage-free.empty .usage-count .remaining {
    color: #f44336;
}

.usage-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.usage-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.3s ease;
}

.usage-free.low .usage-progress-bar {
    background: linear-gradient(90deg, #ff9800 0%, #ffc107 100%);
}

.usage-free.empty .usage-progress-bar {
    background: #f44336;
}

/* 提示弹窗（统一样式 - 登录提示 + 升级提示）*/
.prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.prompt-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
}

.prompt-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounceIn 0.5s ease;
}

.prompt-icon.login-icon {
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.3));
}

.prompt-icon.warning-icon {
    filter: drop-shadow(0 4px 8px rgba(255, 152, 0, 0.3));
}

.prompt-modal h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 700;
}

.prompt-modal > p {
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.5;
}

.prompt-benefits {
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: left;
    border: 2px solid #e9ecef;
}

.prompt-benefits h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    text-align: center;
    font-weight: 600;
}

.prompt-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.prompt-benefits li {
    padding: 12px 0;
    color: #495057;
    font-size: 15px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.prompt-benefits li:last-child {
    border-bottom: none;
}

.prompt-benefits li:hover {
    padding-left: 10px;
    color: #667eea;
}

.prompt-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.prompt-actions button {
    padding: 14px 35px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.prompt-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.prompt-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.prompt-actions .btn-primary:active {
    transform: translateY(0);
}

.prompt-actions .btn-secondary {
    background: #e9ecef;
    color: #6c757d;
}

.prompt-actions .btn-secondary:hover {
    background: #dee2e6;
    color: #495057;
}

/* 兼容旧的类名 */
.upgrade-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

.upgrade-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* 脉冲动画 - 用于高亮登录按钮 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
}

/* 弹跳进入动画 */
@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

