:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-radius: 5px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    margin-left: auto;
    margin-right: 20px;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links a {
    color: var(--dark-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.2rem;
    color: var(--dark-color);
}

h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* 两行布局样式 */
.label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.label-row label {
    flex: 1;
    text-align: center;
    font-weight: 500;
    margin: 0 5px;
    display: block;
}

.input-row {
    display: flex;
    justify-content: space-between;
}

.input-row input {
    flex: 1;
    margin: 0 5px;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"], input[type="number"], textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-success {
    background-color: var(--secondary-color);
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #c0392b;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th, .table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.table tr:hover {
    background-color: #f5f5f5;
}

.result-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.result-item {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.result-value {
    font-family: monospace;
    background-color: #f1f1f1;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    word-break: break-all;
}

.copy-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.copy-btn:hover {
    background-color: #27ae60;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

footer {
    background-color: var(--dark-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    margin-right: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #34495e;
    color: #95a5a6;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin-right: 5px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    text-decoration: none;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
}

.pagination .active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .disabled {
    color: #999;
    cursor: not-allowed;
}

.current-time {
    text-align: center;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.current-time h3 {
    margin-bottom: 0.5rem;
}

.timestamp-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.timestamp-item {
    text-align: center;
}

.timestamp-value {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
}

.timestamp-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

.menu-toggle {
    display: none;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-language {
    display: none;
}

@media (max-width: 768px) {
    .nav-links .language-switcher {
        display: none;
    }
    header {
        position: relative;
    }
    
    nav {
        flex-direction: row;
        align-items: center;
        padding: 0.5rem 0;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: stretch;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: var(--box-shadow);
        z-index: 1000;
    }
    
    .nav-links.show {
        max-height: 400px;
    }
    
    .nav-links li {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        display: block;
        padding: 0.75rem 1rem;
        text-align: left;
    }
    
    .nav-links a:hover, .nav-links a.active {
        background-color: #f8f9fa;
    }
    
    .nav-right {
        margin-left: auto;
    }
    
    .mobile-language {
        display: block;
    }
    
    .mobile-language .btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--dark-color);
        padding: 0.5rem;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-section {
        margin-right: 0;
        margin-bottom: 2rem;
    }
    
    .timestamp-display {
        flex-direction: column;
        gap: 1rem;
    }
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    margin-right: 5px;
}

.tab.active {
    background-color: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
    font-weight: bold;
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Language Switcher Styles */
.language-switcher {
    position: relative;
    margin-left: 20px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 1000;
    min-width: 150px;
    display: none;
}

.language-dropdown.show {
    display: block;
}

.language-option {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.language-option:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.dropdown-arrow {
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* 首页特有样式 */
.history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.history-column {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.history-column h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: white;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.timestamp-link {
    text-decoration: none;
    color: #2c3e50;
    display: block;
}

.timestamp-value {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    word-break: break-all;
}

/* 友情链接样式 */
.friendly-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 1rem;
    justify-content: flex-start;
}

.friendly-link-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    max-width: 300px;
}

.friendly-link-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.friendly-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s ease;
    min-width: 200px;
}

.friendly-link:hover {
    color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.link-icon {
    font-size: 1.2em;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.link-text {
    font-weight: 500;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .history-grid {
        grid-template-columns: 1fr;
    }
    
    .friendly-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .friendly-link {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .friendly-links-grid {
        grid-template-columns: 1fr;
    }
}