/* 全局样式 - 现代化专业版 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.4;
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4px 20px;
}

/* 头部样式 - 现代玻璃态效果 */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header:hover {
    box-shadow: var(--shadow-xl);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 20px;
}

.header h1 {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
}

.user-info span {
    font-weight: 500;
    color: var(--gray);
}

.user-info strong {
    color: var(--dark);
    font-weight: 600;
}

.subscription-badge {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

/* 按钮样式 - 现代渐变设计 */
.btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(238, 90, 36, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-outline {
    background: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 主容器 - 现代卡片设计 */
.main-container {
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
}

.main-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), #f093fb);
}

/* 消息样式 - 现代提示框 */
.message {
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.message.success {
    background: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.message.error {
    background: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.message.warning {
    background: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

/* 结果框 - 醒目展示 */
.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
}

.result-box::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

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

.result-box h2 {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.k-value {
    font-size: 16px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.k-value span {
    font-size: 32px;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: block;
    margin: 6px 0;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 计算器框 - 优雅设计 */
.calculator-box {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.calculator-box h2 {
    color: var(--primary-color);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--primary-color);
    font-size: 16px;
    font-weight: 700;
}

.calculator-box h3 {
    color: var(--dark);
    margin: 6px 0 4px 0;
    font-size: 14px;
    font-weight: 600;
}

/* 表单样式 - 现代输入框 */
.form-group {
    margin-bottom: 6px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--dark);
    font-size: 13px;
    letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
    border-color: var(--primary-color);
    background: #f9fafb;
}

/* 玻璃层配置表格 - 专业数据表 */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 6px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid #e5e7eb;
}

.glass-table th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 6px 6px;
    text-align: center;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    border: none;
}

.glass-table td {
    padding: 4px 4px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    background: white;
    transition: all 0.2s ease;
}

.glass-table tbody tr:hover td {
    background: #f9fafb;
    transform: scale(1.01);
}

.glass-table tbody tr:last-child td {
    border-bottom: none;
}

.glass-table input,
.glass-table select {
    width: 100%;
    padding: 3px 4px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 12px;
    background: white;
}

.glass-table input:focus,
.glass-table select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 辐射率上传 - 特色功能区 */
.emissivity-upload {
    background: white;
    padding: 8px;
    border-radius: 8px;
    margin: 8px 0;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.emissivity-upload:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

.emissivity-result {
    background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
    padding: 12px;
    border-radius: 10px;
    margin-top: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.emissivity-result p {
    margin: 6px 0;
    font-weight: 500;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.emissivity-result p strong {
    color: var(--primary-dark);
    font-size: 16px;
}

/* 标准选择器 - 单选组 */
.standard-selector {
    background: white;
    padding: 6px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid #e5e7eb;
    box-shadow: var(--shadow-sm);
}

.standard-selector label {
    display: inline-flex;
    align-items: center;
    margin-right: 30px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.standard-selector label:hover {
    background: var(--light-gray);
}

.standard-selector input[type="radio"] {
    margin-right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* 表单动作按钮组 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.form-actions .btn {
    min-width: 130px;
    font-size: 13px;
    padding: 6px 18px;
}

/* 认证页面样式 - 登录注册 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 480px;
}

.auth-box {
    background: white;
    padding: 50px 45px;
    border-radius: 20px;
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
}

.auth-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), #f093fb);
}

.auth-box h1 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 36px;
    font-size: 32px;
    font-weight: 800;
}

.trial-notice {
    text-align: center;
    color: var(--success-color);
    font-weight: 700;
    margin-bottom: 24px;
    padding: 12px;
    background: #d1fae5;
    border-radius: 8px;
    font-size: 14px;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* 真空参数配置 - 特殊配置区 */
.vacuum-params {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid var(--warning-color);
    box-shadow: var(--shadow-sm);
}

.vacuum-params h4 {
    color: #92400e;
    margin-bottom: 16px;
    font-weight: 700;
}

.vacuum-params .form-group {
    margin-bottom: 12px;
}

.vacuum-params label {
    display: inline-block;
    width: 180px;
    font-weight: 600;
    color: #92400e;
}

.vacuum-params input {
    width: calc(100% - 200px);
    padding: 10px;
    border: 2px solid #fbbf24;
    border-radius: 6px;
}

.vacuum-params input:focus {
    border-color: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* 管理后台样式 */
.admin-nav {
    background: white;
    padding: 16px 0;
    margin-bottom: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.admin-nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
    padding: 0 24px;
}

.admin-nav a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-block;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--primary-color);
    color: white;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-top: 24px;
}

.admin-table th {
    background: linear-gradient(135deg, var(--dark) 0%, #374151 100%);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card h3 {
    color: var(--gray);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-card .stat-label {
    color: var(--gray);
    font-size: 13px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 8px;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .user-info {
        flex-direction: column;
        text-align: center;
    }

    .main-container {
        padding: 24px 20px;
    }

    .calculator-box {
        padding: 24px 16px;
    }

    .glass-table {
        font-size: 12px;
    }

    .glass-table th,
    .glass-table td {
        padding: 10px 6px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        min-width: auto;
    }

    .auth-box {
        padding: 35px 25px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav ul {
        flex-direction: column;
        gap: 8px;
    }

    .vacuum-params label {
        width: 100%;
        display: block;
        margin-bottom: 8px;
    }

    .vacuum-params input {
        width: 100%;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }

    .header,
    .btn,
    .form-actions,
    .auth-links {
        display: none;
    }

    .main-container {
        box-shadow: none;
    }
}

/* 深色模式支持 (可选) */
@media (prefers-color-scheme: dark) {
    /* 可以在此添加深色模式样式 */
}

/* 辅助类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.hidden { display: none; }
.visible { display: block; }
