/* iOS风格清新样式 */
:root {
    --primary-color: #007AFF;
    --primary-hover: #0056CC;
    --primary-light: #5AC8FA;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --background-color: #F2F2F7;
    --background-secondary: #FFFFFF;
    --card-background: #FFFFFF;
    --card-background-hover: #F9F9F9;
    --text-primary: #000000;
    --text-secondary: #6D6D70;
    --text-muted: #8E8E93;
    --border-color: rgba(60, 60, 67, 0.12);
    --border-color-hover: rgba(60, 60, 67, 0.18);
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-radius-small: 8px;
    --border-radius-large: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --gradient-primary: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    --gradient-secondary: linear-gradient(135deg, #00C7BE 0%, #007AFF 100%);
    --gradient-success: linear-gradient(135deg, #34C759 0%, #30D158 100%);
    --gradient-yaohuo: linear-gradient(135deg, #5FCFCF 0%, #1ABC9C 100%);
    --yaohuo-light: #E5F3EE;
    --yaohuo-accent: #4BA0A0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景装饰 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #4facfe, #00f2fe);
    bottom: 20%;
    left: 50%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding: 2rem;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.app-logo {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.app-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2rem;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: stretch;
}

/* Service Card Styles */
.service-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.service-card.auth-code-card {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05), rgba(88, 86, 214, 0.05));
    border-color: rgba(0, 122, 255, 0.2);
}

.service-card.yaohuo-card {
    background: linear-gradient(135deg, var(--yaohuo-light), rgba(95, 207, 207, 0.1));
    border-color: var(--yaohuo-accent);
    display: flex;
    flex-direction: column;
}

.service-header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.service-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.8rem;
    box-shadow: var(--shadow-card);
}

.auth-code-card .service-icon {
    background: var(--gradient-primary);
}

.yaohuo-card .service-icon {
    background: var(--gradient-yaohuo);
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.service-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.service-content {
    padding: 0 2rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--card-background);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 48px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-card);
}

.btn-yaohuo {
    background: var(--gradient-yaohuo);
    color: white;
    box-shadow: var(--shadow-card);
}

.btn-secondary {
    background: var(--card-background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Turnstile Container */
.turnstile-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    min-height: 65px; /* Fixed height to prevent layout shift */
    align-items: center;
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    margin: 1rem 0;
}

.loading.show {
    display: block;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Display */
.result-display {
    display: none;
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: var(--border-radius-small);
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.result-display.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-label {
    font-size: 0.9rem;
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.result-value {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.copy-btn {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

/* Message Styles */
.message {
    padding: 1rem;
    border-radius: var(--border-radius-small);
    margin: 1rem 0;
    display: none;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.show {
    display: block;
}

.message.error {
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: var(--error-color);
}

.message.success {
    background: rgba(52, 199, 89, 0.1);
    border: 1px solid rgba(52, 199, 89, 0.3);
    color: var(--success-color);
}

/* Statistics Section */
.stats-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.stats-content {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.stats-loading {
    color: var(--text-muted);
    font-style: italic;
}

.stats-highlight {
    color: var(--primary-color);
    font-weight: 700;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--border-radius-small);
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    min-width: 120px;
}

.footer-link[href*="github"] {
    background: var(--gradient-primary);
}

.footer-link[href*="github"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #0056CC 0%, #4640C7 100%);
}

.footer-link[onclick*="AnyProxy"] {
    background: var(--gradient-yaohuo);
}

.footer-link[onclick*="AnyProxy"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, #4BA0A0 0%, #16A085 100%);
}

.footer-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.footer-link:hover::before {
    left: 100%;
}

.footer-link[href*="github"]::after {
    content: '📦';
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

.footer-link[onclick*="AnyProxy"]::after {
    content: '🔗';
    margin-left: 0.5rem;
    font-size: 0.9rem;
}

/* 脉冲动画 */
@keyframes pulse {
    0% { box-shadow: var(--shadow-card); }
    50% { box-shadow: var(--shadow-medium), 0 0 0 4px rgba(0, 122, 255, 0.1); }
    100% { box-shadow: var(--shadow-card); }
}

.footer-link[onclick*="AnyProxy"] {
    animation: pulse 3s ease-in-out infinite;
    animation-delay: 2s;
}

.copyright {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.version {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-small);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--error-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .app-logo {
        font-size: 2.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .service-content {
        padding: 0 1.5rem 1.5rem;
    }

    .service-icon {
        width: 56px;
        height: 56px;
        font-size: 1.6rem;
    }

    .service-title {
        font-size: 1.3rem;
    }

    .service-description {
        font-size: 0.9rem;
    }

    .stats-section {
        padding: 1.5rem;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .footer-link {
        width: 100%;
        max-width: 250px;
        padding: 0.875rem 1.5rem;
    }

    .toast {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        transform: translateY(-100%);
    }

    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.5rem;
    }

    .app-logo {
        font-size: 2rem;
    }

    .service-header {
        padding: 1rem;
    }

    .service-content {
        padding: 0 1rem 1rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Yaohuo Card Specific Styles */
.yaohuo-card .service-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.yaohuo-card .service-content .btn {
    margin-top: auto;
}

.yaohuo-card .service-content > p {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }