:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --accent-color: #fd5e53;
    --light-color: #ffffff;
    --dark-color: #2c3e50;
    --gray-color: #7f8c8d;
    --light-bg: #f8f9fa;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

body {
    background: linear-gradient(135deg, rgba(177, 228, 255, 0.64) 0%, rgba(0, 119, 255, 0.45) 100%);
    color: var(--dark-color);
    min-height: 100vh;
    padding: 30px;
    line-height: 1.6;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

h2 {
    color: var(--dark-color);
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color)) 1;
    padding-bottom: 15px;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

/* 文件输入区域 */
input[type="file"] {
    width: 100%;
    padding: 15px 20px;
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    background: var(--light-bg);
    font-size: 1rem;
    transition: var(--transition);
    margin: 20px 0;
    cursor: pointer;
}

input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(106, 17, 203, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.1);
}

/* 按钮样式 */
button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    margin: 10px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.4);
}

button:active {
    transform: translateY(-1px);
}

/* 复选框 */
label {
    font-size: 1rem;
    margin: 0 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* 结果展示区域 */
#calcResult {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(52, 152, 219, 0.1));
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    border-left: 4px solid var(--success);
    backdrop-filter: blur(5px);
}

/* 双列布局（响应式） */
.half-width {
    width: 48%;
    margin: 1%;
    float: left;
    box-sizing: border-box;
    background: var(--light-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.half-width:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: var(--light-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    resize: vertical;
    font-size: 0.9rem;
    line-height: 1.5;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

h3 {
    margin: 20px 0 15px;
    clear: both;
    color: var(--dark-color);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3::before {
    content: '';
    width: 6px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

th, td {
    border: none;
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background: rgba(106, 17, 203, 0.02);
}

tr:hover {
    background: rgba(106, 17, 203, 0.05);
    transform: scale(1.01);
    transition: var(--transition);
}

/* 清除浮动 */
hr {
    clear: both;
    margin: 30px 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    border-radius: 2px;
}

.calc-info strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* MCZ 文件选择样式 */
#mczFileSelect {
    display: none;
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 243, 205, 0.8), rgba(255, 238, 186, 0.8));
    border: 2px solid #ffeeba;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

#mczFileSelect select {
    padding: 12px 15px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    margin: 0 10px;
    background: white;
    font-size: 1rem;
    transition: var(--transition);
}

#mczFileSelect select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

/* 按钮组居中 */
.button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 30px 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    animation: fadeIn 0.6s ease-out;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--secondary-color), var(--primary-color));
}

/* 新增：手机样式适配 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        font-size: 14px;
    }

    .container {
        padding: 20px;
        border-radius: 15px;
        margin: 10px;
    }

    h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    h2::after {
        width: 60px;
    }

    h3 {
        font-size: 1.2rem;
        margin: 15px 0 10px;
    }

    .half-width {
        width: 100%;
        margin: 10px 0;
        padding: 15px;
    }

    input[type="file"] {
        padding: 12px 15px;
        margin: 15px 0;
        font-size: 0.9rem;
    }

    button {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin: 5px;
        width: calc(100% - 10px);
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
        margin: 20px 0;
    }

    label {
        margin: 5px 10px;
        font-size: 0.9rem;
    }

    textarea {
        height: 200px;
        font-size: 0.85rem;
        padding: 12px;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 10px 8px;
    }

    #calcResult {
        padding: 15px;
        margin: 15px 0;
    }

    #mczFileSelect {
        padding: 15px;
        margin: 15px 0;
    }

    #mczFileSelect select {
        width: 100%;
        margin: 10px 0;
    }

    hr {
        margin: 20px 0;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 12px;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .half-width {
        padding: 12px;
    }

    input[type="file"] {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    button {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    textarea {
        height: 150px;
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    textarea {
        height: 120px;
    }

    .half-width {
        padding: 10px;
    }
}

/* 高分辨率屏幕适配 */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    button, #mczFileSelect {
        display: none;
    }
}