/* 主样式文件 - Global Currency Converter */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a2a6c, #2d1a6c);
    color: #333;
    min-height: 100vh;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
}

.main-content {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #1a73e8;
    color: white;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-selector {
    position: relative;
}

.language-dropdown {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='white' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
    min-width: 120px;
}

.language-dropdown option {
    background: #1a73e8;
    color: white;
}

.language-dropdown:hover {
    background: rgba(255, 255, 255, 0.3);
}

.share-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
main {
    padding: 30px;
}

.section-title {
    color: #1a73e8;
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title svg {
    width: 24px;
    height: 24px;
}

/* Converter Section */
.converter-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eaeaea;
}

.converter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.amount-input {
    flex: 1;
    min-width: 120px;
}

.amount-input input {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border 0.3s;
}

.amount-input input:focus {
    border-color: #1a73e8;
    outline: none;
}

.currency-selectors {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 2;
    min-width: 250px;
}

.currency-select {
    flex: 1;
    position: relative;
}

.currency-select select {
    width: 100%;
    padding: 14px 14px 14px 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    background-color: white;
    transition: border 0.3s;
    appearance: none;
}

.currency-select select:focus {
    border-color: #1a73e8;
    outline: none;
}

.currency-flag-select {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.convert-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.convert-btn:hover {
    background: #0d62d9;
    transform: translateY(-2px);
}

.conversion-result {
    padding: 20px;
    background: #f1f8ff;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    color: #1a73e8;
    border-left: 4px solid #1a73e8;
}

/* Exchange Rates Section */
.exchange-rates-section {
    margin-bottom: 20px;
}

.base-currency-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.base-currency-selector label {
    font-weight: 500;
    color: #555;
}

.base-currency-selector .currency-select {
    width: 300px;
    flex: none;
}

.base-currency-selector .currency-select select {
    width: 100% !important;
}

.rates-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.add-currency-form {
    display: flex;
    gap: 10px;
}

.add-currency-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 200px;
}

.add-currency-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.add-currency-btn:hover {
    background: #218838;
}

.last-updated {
    color: #666;
    font-size: 14px;
}

/* Rates Table */
.rates-table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rates-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.rates-table th {
    text-align: left;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eaeaea;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.rates-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #eaeaea;
    cursor: pointer;
    transition: background 0.2s;
}

.rates-table tr:hover {
    background-color: #f8f9fa;
}

.rates-table tr:hover td {
    background-color: #f1f8ff;
}

.currency-flag {
    margin-right: 10px;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.currency-name {
    display: flex;
    align-items: center;
}

.currency-code {
    font-weight: 600;
    color: #1a73e8;
}

.change-positive {
    color: #28a745;
    font-weight: 500;
}

.change-negative {
    color: #dc3545;
    font-weight: 500;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.remove-btn:hover {
    background: #c82333;
}



.footer-content h3 {
    color: #1a73e8;
    margin-bottom: 15px;
    font-size: 18px;
}

.footer-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Utility Classes */
.loading {
    text-align: center;
    padding: 30px;
    color: #777;
}

.error {
    text-align: center;
    padding: 15px;
    background: #f8d7da;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 500;
    color: #dc3545;
}

.visitor-counter {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    background: #ffffff;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    color: #495057;
    border: 1px solid #ced4da;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 1000;
    white-space: nowrap;
}

.visitor-counter .visitor-text {
    color: #6c757d;
    font-weight: 400;
}

.visitor-counter .visitor-number {
    color: #007bff;
    font-weight: 600;
}

/* SEO Content */
.seo-content {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.seo-content h2 {
    color: #1a73e8;
    margin-bottom: 15px;
    font-size: 20px;
}

.seo-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Info Footer */
.info-footer {
    margin-top: 40px;
    padding: 30px 0;
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
}

.info-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.info-footer h3 {
    color: #1a73e8;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: left;
}

.info-footer .footer-description {
    line-height: 1.7;
    color: #555;
    margin-bottom: 20px;
}

.info-footer .footer-description p {
    margin-bottom: 12px;
}

.info-footer .footer-copyright {
    font-size: 14px;
    color: #777;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eaeaea;
}

/* Partner Websites */
.partner-websites {
    margin-top: 60px;
    padding: 40px;
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
    border-radius: 8px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.partner-websites h3 {
    color: #1a73e8;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.partner-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.partner-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.partner-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #1a73e8;
}

.partner-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.partner-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.partner-link {
    display: inline-block;
    background: #1a73e8;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.partner-link:hover {
    background: #0d62d9;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .converter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .currency-selectors {
        flex-direction: column;
        gap: 10px;
    }
    
    .rates-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-currency-form {
        width: 100%;
    }
    
    .add-currency-form input {
        flex: 1;
    }
    
    .base-currency-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .base-currency-selector .currency-select {
        width: 100%;
    }
}

/* Simple Footer Styles */
.simple-footer {
    background: #f8f9fa;
    border-top: 1px solid #eaeaea;
    padding: 40px 0;
    margin-top: 60px;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: 0;
}

.simple-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    position: relative;
    min-height: 100px; /* 确保有足够空间显示访客计数器 */
}

.simple-footer .footer-content .footer-nav {
    margin-bottom: 20px;
}

.simple-footer .footer-content .footer-nav a {
    color: #1a73e8;
    text-decoration: none;
    margin: 0 15px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.simple-footer .footer-content .footer-nav a:hover {
    color: #0d62d9;
    text-decoration: underline;
}

.simple-footer .footer-content .footer-info {
    margin-bottom: 10px;
    line-height: 1.5;
}

.simple-footer .footer-content .copyright {
    font-size: 13px;
    color: #777;
    margin-top: 10px;
}