:root {
    --primary: #8a2dff;
    --secondary: #2575fc;
    --accent: #fd5e53;
    --light: #ffffff;
    --dark: #2c3e50;
    --success: #2ecc71;
    --warning: #f39c12;
    --info: #3498db;
    --gray: #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: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--dark);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--card-shadow);
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    background: linear-gradient(45deg, #fff, #fd5e53);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.panel {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    flex: 1;
    min-width: 400px;
    max-width: 600px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

.description {
    text-align: center;
    margin-bottom: 25px;
    color: var(--gray);
    font-size: 1rem;
    line-height: 1.6;
}

.rule {
    background: linear-gradient(to right, rgba(37, 117, 252, 0.1), rgba(106, 17, 203, 0.1));
    border-left: 4px solid var(--secondary);
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 0 10px 10px 0;
    font-size: 0.95rem;
}

.rule i {
    color: var(--secondary);
    margin-right: 8px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
}

label i {
    margin-right: 10px;
    color: var(--primary);
}

input, select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--light-bg);
}

input:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
}

.buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(106, 17, 203, 0.3);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(106, 17, 203, 0.4);
}

.secondary-btn {
    background: var(--light-bg);
    color: var(--dark);
}

.secondary-btn:hover {
    background: #e0e0e0;
}

.tertiary-btn {
    background: linear-gradient(135deg, var(--accent), #ff9f43);
    color: white;
    box-shadow: 0 4px 15px rgba(253, 94, 83, 0.3);
}

.tertiary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(253, 94, 83, 0.4);
}

.file-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--light-bg);
    padding: 10px;
    border-radius: 10px;
    border: 2px dashed #ccc;
    transition: var(--transition);
}

.file-input:hover {
    border-color: var(--primary);
    background: rgba(106, 17, 203, 0.05);
}

.file-input input[type="file"] {
    flex: 1;
    border: none;
    padding: 0;
    background: transparent;
}

.file-name {
    font-size: 0.9rem;
    color: var(--gray);
    font-style: italic;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(52, 152, 219, 0.1));
    border-radius: 10px;
    border-left: 4px solid var(--success);
}

.result h3 {
    color: var(--success);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calculation-details {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.calculation-details p {
    margin-bottom: 8px;
}

.footer {
    text-align: center;
    margin-top: 50px;
    font-size: 0.9rem;
    color: white;
    opacity: 0.8;
    padding: 20px;
}

.badge {
    display: inline-block;
    background: rgba(253, 94, 83, 0.2);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    margin-top: 10px;
    backdrop-filter: blur(5px);
}

/* 新增的使用方法样式 */
.usage-guide {
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.1), rgba(37, 117, 252, 0.1));
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.usage-guide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(106, 17, 203, 0.05), rgba(37, 117, 252, 0.05));
    z-index: 0;
}

.usage-guide h3 {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.usage-guide ol {
    padding-left: 20px;
    position: relative;
    z-index: 1;
}

.usage-guide li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.usage-guide strong {
    color: var(--primary);
}

.usage-guide .example {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    font-size: 0.9rem;
    border-left: 3px solid var(--accent);
}

.usage-guide .example-title {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.status-success {
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-error {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        align-items: center;
    }

    .panel {
        width: 100%;
        max-width: 100%;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .buttons {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel {
    animation: fadeIn 0.5s ease-out;
}

.panel:nth-child(2) {
    animation-delay: 0.2s;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--secondary), var(--primary));
}

/* 新增：手机样式适配 */
@media (max-width: 768px) {
    body {
        padding: 15px;
        font-size: 14px;
    }

    .app-container {
        max-width: 100%;
    }

    .header {
        padding: 15px;
        margin-bottom: 30px;
        border-radius: 15px;
    }

    .header h1 {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .header p {
        font-size: 1rem;
    }

    .container {
        gap: 20px;
    }

    .panel {
        padding: 20px;
        border-radius: 15px;
        min-width: 100%;
    }

    h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    h2::after {
        width: 50px;
        height: 2px;
    }

    .description {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    .rule {
        padding: 12px;
        margin-bottom: 20px;
        font-size: 0.9rem;
    }

    .input-group {
        margin-bottom: 15px;
    }

    label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    input, select {
        padding: 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .buttons {
        gap: 10px;
        margin-top: 25px;
    }

    button {
        padding: 12px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .file-input {
        padding: 8px;
        border-radius: 8px;
    }

    .file-name {
        font-size: 0.85rem;
    }

    .result {
        margin-top: 20px;
        padding: 15px;
        border-radius: 8px;
    }

    .result h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .calculation-details {
        margin-top: 12px;
        padding: 12px;
        font-size: 0.85rem;
    }

    .usage-guide {
        padding: 15px;
        margin-bottom: 20px;
    }

    .usage-guide h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .usage-guide li {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .usage-guide .example {
        padding: 10px;
        font-size: 0.85rem;
    }

    .status-message {
        margin-top: 12px;
        padding: 8px;
        font-size: 0.9rem;
    }

    .footer {
        margin-top: 40px;
        padding: 15px;
        font-size: 0.85rem;
    }

    .badge {
        padding: 4px 12px;
        font-size: 0.85rem;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    body {
        padding: 10px;
        font-size: 13px;
    }

    .header {
        padding: 12px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .header p {
        font-size: 0.9rem;
    }

    .container {
        gap: 15px;
    }

    .panel {
        padding: 15px;
        border-radius: 12px;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }

    .description {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }

    .input-group {
        margin-bottom: 12px;
    }

    label {
        font-size: 0.85rem;
    }

    input, select {
        padding: 10px;
        font-size: 0.85rem;
    }

    button {
        padding: 10px;
        font-size: 0.85rem;
    }

    .result {
        padding: 12px;
    }

    .usage-guide {
        padding: 12px;
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 10px;
    }

    .header {
        padding: 15px;
        margin-bottom: 20px;
    }

    .panel {
        padding: 20px;
    }
}

/* 高分辨率屏幕适配 */
@media (min-width: 1200px) {
    .app-container {
        max-width: 1400px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        color: black;
        padding: 0;
    }

    .header {
        background: white;
        color: black;
        box-shadow: none;
    }

    .header h1 {
        background: none;
        color: black;
        -webkit-text-fill-color: black;
    }

    .panel {
        background: white;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    button {
        display: none;
    }
}