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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    padding: 15px;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.title {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-button {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-button.active {
    background: #007AFF;
    color: white;
}

.nav-button:hover:not(.active) {
    background: rgba(0, 122, 255, 0.1);
}

.tool-section {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tool-section.active {
    opacity: 1;
    height: auto;
    overflow: visible;
}

.input-group {
    margin-bottom: 20px;
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.input-field {
    flex: 1;
    min-width: 250px;
    max-width: 100%;
}

.input-field label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.input-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.input-field input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.results {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.result-card {
    background: rgba(227, 242, 253, 0.8);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    min-width: 200px;
    flex: 1;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.price {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.margin {
    color: #666;
    font-size: clamp(0.8rem, 2.5vw, 1rem);
}

.price-points {
    margin-top: 20px;
    padding: 15px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.price-points label {
    display: block;
    margin-bottom: 10px;
    color: #666;
    font-size: clamp(0.9rem, 2.5vw, 1rem);
}

.price-tag {
    display: inline-block;
    padding: 5px 10px;
    margin: 4px;
    background: rgba(233, 236, 239, 0.8);
    border-radius: 8px;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

.language-selector select {
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    background: rgba(255, 255, 255, 0.8);
}

.calculate-button {
    padding: 12px 24px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 15px;
    width: 100%;
    max-width: 200px;
}

.calculate-button:hover {
    background: #0056b3;
}

.copyright {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .card {
        padding: 15px;
    }

    .nav-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 8px;
        gap: 8px;
    }

    .nav-button {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
    }

    .input-field {
        min-width: 100%;
    }

    .result-card {
        min-width: 100%;
    }

    .language-selector {
        position: static;
        text-align: right;
        margin-bottom: 15px;
    }
}

/* 历史记录部分的样式 */
.history-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

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

.history-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.clear-history-button {
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.clear-history-button:hover {
    background: #c82333;
}

.no-history {
    text-align: center;
    color: #666;
    font-style: italic;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.history-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.history-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.9rem;
}

.history-details span {
    background: rgba(233, 236, 239, 0.8);
    padding: 3px 8px;
    border-radius: 4px;
}

.loading {
    text-align: center;
    color: #666;
    padding: 10px;
}

.error {
    text-align: center;
    color: #dc3545;
    padding: 10px;
}

.refresh-button-container {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

.refresh-button {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.refresh-button:hover {
    background: #218838;
}

.refresh-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.refresh-button.loading {
    pointer-events: none;
    background: #28a745;
    opacity: 0.9;
}

.refresh-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    border-left-color: white;
    animation: ios-spin 0.8s linear infinite;
}

@keyframes ios-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.refresh-button:active {
    transform: scale(0.96);
    background: #218838;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.history-button {
    padding: 8px 16px;
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.history-button:hover {
    background: #004494;
}

.rate-history-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.history-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 500;
}

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

.export-button, .clear-history-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-button {
    background: #28a745;
    color: white;
}

.export-button:hover {
    background: #218838;
}

.clear-history-button {
    background: #dc3545;
    color: white;
}

.clear-history-button:hover {
    background: #c82333;
}

.rate-history-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.rate-history-item {
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(248, 249, 250, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.rate-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.history-date {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.rate-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rate-details span {
    background: rgba(233, 236, 239, 0.8);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
    font-family: monospace;
}

.no-history {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* 适配移动设备 */
@media (max-width: 768px) {
    .rate-history-section {
        padding: 15px;
    }

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

    .history-actions {
        width: 100%;
        justify-content: space-between;
    }

    .rate-details {
        gap: 8px;
    }

    .rate-details span {
        width: calc(50% - 4px);
        text-align: center;
    }
}

footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
}

footer p {
    margin: 0;
    color: #666;
}

footer a {
    color: #666;
    text-decoration: none;
    margin: 0 5px;
}

footer a:hover {
    text-decoration: underline;
}

.beian {
    margin-top: 5px;
}

.beian a {
    font-size: 0.9em;
    color: #666;
}

/* 更新说明弹窗样式 */
.update-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.update-modal-content {
    position: relative;
    background: white;
    margin: 15% auto;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: modalFadeIn 0.3s ease;
    z-index: 10000;
}

.update-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.update-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0 5px;
}

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

.version-item {
    margin-bottom: 20px;
}

.version-item h4 {
    color: #0056b3;
    margin: 0 0 10px 0;
}

.version-item ul {
    margin: 0;
    padding-left: 20px;
}

.version-item li {
    margin: 5px 0;
    color: #666;
}

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

/* 适配移动设备 */
@media (max-width: 768px) {
    .update-modal-content {
        width: 90%;
        margin: 30% auto;
    }
} 