* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header .user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.header .user-info .username {
    font-size: 1em;
}

.header .user-info .logout-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.header .user-info .logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.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 {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.size-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

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

.result-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.result-card h2 {
    color: white;
    border-bottom-color: white;
}

.result-display {
    text-align: center;
    padding: 30px;
}

.result-display .price {
    font-size: 4em;
    font-weight: bold;
    margin: 20px 0;
}

.result-display .label {
    font-size: 1.2em;
    opacity: 0.9;
}

.multi-currency {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.currency-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.currency-label {
    font-size: 1em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.currency-price {
    font-size: 2.5em;
    font-weight: bold;
}

.formula-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.formula-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.admin-toggle {
    text-align: right;
    margin-bottom: 10px;
}

.admin-toggle button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.admin-toggle button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.admin-section {
    display: block;
}

.info-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.error-message {
    color: #f44336;
    background: #ffebee;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.success-message {
    color: #4caf50;
    background: #e8f5e9;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

.success-message:not(:empty) {
    display: block;
}

/* 登录页面样式 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    max-width: 400px;
    width: 100%;
}

/* 管理员页面样式 */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.user-table th,
.user-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.user-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.user-table tr:hover {
    background: #f9f9f9;
}

.user-table .actions {
    display: flex;
    gap: 10px;
}

.user-table .btn-small {
    padding: 6px 12px;
    font-size: 14px;
    width: auto;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #333;
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .result-card {
        grid-column: 1;
    }

    .formula-group {
        grid-template-columns: 1fr;
    }

    .multi-currency {
        grid-template-columns: 1fr;
    }

    .header .user-info {
        flex-direction: column;
        gap: 10px;
    }
}
