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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    color: #333;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.nav {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 20px;
    overflow-anchor: none;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-logo {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.nav-links { display: flex; gap: 8px; }
.drawer-user { display: none; }
.nav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { background: #f0f2ff; color: #667eea; }

/* ===== Mobile Nav Toggle ===== */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #667eea;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile nav overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 98;
    animation: fadeIn 0.2s ease;
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-user { margin-left: auto; }
    .nav { position: fixed; left: 0; right: 0; }
    .main { padding-top: 24px; }
    .main::before { content: ''; display: block; height: 56px; }
    /* Mobile performance: disable all hero decorative elements */
    .hero-orb,
    .hero-particle,
    .hero-ring { display: none !important; }
    .hero-btns .btn::before { animation: none !important; opacity: 0.3; }
    .hero { border-radius: 0; isolation: auto; }
    .hero::before { display: none; }
    .nav { box-shadow: none; }
    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 260px;
        height: 100vh;
        height: 100dvh;
        background: #fff;
        flex-direction: column;
        padding: 0;
        gap: 0;
        box-shadow: -4px 0 24px rgba(0,0,0,0.12);
        z-index: 99;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .nav-links.open { right: 0; }
    .nav-overlay.show { display: block; }

    /* Drawer header */
    .nav-links::before {
        content: '菜单导航';
        display: block;
        padding: 56px 20px 12px;
        font-size: 13px;
        font-weight: 600;
        color: #999;
        letter-spacing: 1px;
        text-transform: uppercase;
        background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
        border-bottom: 1px solid #eee;
    }

    .nav-links a {
        padding: 14px 20px;
        font-size: 15px;
        border-radius: 0;
        color: #444;
        border-bottom: 1px solid #f5f5f5;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .nav-links a:last-child { border-bottom: none; }
    .nav-links a:hover, .nav-links a.active {
        background: linear-gradient(135deg, #f0f2ff, #e8ecff);
        color: #667eea;
    }
    .nav-links a.active {
        font-weight: 600;
        border-left: 3px solid #667eea;
        padding-left: 17px;
    }

    /* Mobile: hide text in nav-user, keep icons */
    .nav-user .user-name,
    .nav-user .btn-topup span,
    .nav-user .btn-signin span {
        display: none;
    }
    .nav-user .btn-topup, .nav-user .btn-signin {
        padding: 6px 8px;
        font-size: 13px;
        min-width: 32px;
        justify-content: center;
    }
    .nav-user .points-badge { font-size: 11px; padding: 2px 8px; gap: 2px; }
    .nav-user .points-badge::before { font-size: 11px; }
    .btn-outline { padding: 5px 8px !important; font-size: 12px !important; min-width: 32px; text-align: center; }

    /* Drawer user section */
    .drawer-user {
        display: block !important;
        margin-top: auto;
        padding: 16px 20px;
        border-top: 1px solid #eee;
        background: #fafbff;
    }
    .drawer-user .drawer-user-info {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }
    .drawer-user .drawer-user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 600;
        flex-shrink: 0;
    }
    .drawer-user .drawer-user-name {
        font-size: 14px;
        font-weight: 600;
        color: #333;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .drawer-user .drawer-user-points {
        font-size: 12px;
        color: #e65100;
        white-space: nowrap;
    }
    .drawer-user .drawer-user-points::before { content: '💎'; margin-right: 3px; }
    .drawer-user .drawer-actions {
        display: flex;
        gap: 8px;
    }
    .drawer-user .drawer-actions button {
        flex: 1;
        padding: 10px;
        border-radius: 10px;
        border: none;
        font-size: 13px;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 500;
    }
    .drawer-user .drawer-btn-topup {
        background: linear-gradient(135deg, #ff6b35, #f7931e);
        color: #fff;
        box-shadow: 0 2px 8px rgba(255,107,53,0.25);
    }
    .drawer-user .drawer-btn-topup:active { opacity: 0.9; }
    .drawer-user .drawer-btn-signin {
        background: linear-gradient(135deg, #667eea, #764ba2);
        color: #fff;
    }
    .drawer-user .drawer-btn-signin:active { opacity: 0.9; }
    .drawer-user .drawer-btn-logout {
        background: #fff;
        color: #e53935;
        border: 1px solid #ffcdd2 !important;
    }
    .drawer-user .drawer-btn-logout:active { background: #fff5f5; }
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.nav-user .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.nav-user .user-name {
    color: #444;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-user .points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 1px solid #ffe082;
    color: #e65100;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.nav-user .points-badge::before {
    content: '💎';
    font-size: 12px;
}
.btn-topup {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}
.btn-topup:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,107,53,0.35); }
.nav-user button {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.btn-outline { background: #fff; color: #667eea; border: 1px solid #667eea !important; }
.btn-outline:hover { background: #667eea; color: #fff; }
.btn-login { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }

.main { max-width: 1200px; margin: 0 auto; padding: 24px 20px; }

/* ===== Tech Hero Section ===== */
.hero {
    position: relative;
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1a4e 30%, #16213e 60%, #0f3460 100%);
    border-radius: 20px;
    color: #fff;
    margin-bottom: 40px;
    overflow: hidden;
    isolation: isolate;
    overflow-anchor: none;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(102,126,234,0.08) 1px, transparent 1px),
        linear-gradient(rgba(102,126,234,0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    z-index: 0;
    animation: orbFloat 6s ease-in-out infinite;
    background: radial-gradient(circle at 35% 35%, currentColor 0%, transparent 70%);
}
.hero-orb:nth-child(1) {
    width: 300px; height: 300px;
    color: #667eea;
    top: -80px; left: -60px;
    animation-delay: 0s;
}
.hero-orb:nth-child(2) {
    width: 250px; height: 250px;
    color: #764ba2;
    bottom: -60px; right: -40px;
    animation-delay: -2s;
}
.hero-orb:nth-child(3) {
    width: 200px; height: 200px;
    color: #00d2ff;
    top: 50%; left: 60%;
    animation-delay: -4s;
}
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}
.hero-particle {
    position: absolute;
    width: 4px; height: 4px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    z-index: 0;
    animation: particleTwinkle 3s ease-in-out infinite;
}
.hero-particle:nth-child(4) { top: 15%; left: 10%; animation-delay: 0s; width: 3px; height: 3px; }
.hero-particle:nth-child(5) { top: 25%; left: 85%; animation-delay: -0.6s; }
.hero-particle:nth-child(6) { top: 60%; left: 5%; animation-delay: -1.2s; width: 5px; height: 5px; }
.hero-particle:nth-child(7) { top: 70%; left: 78%; animation-delay: -1.8s; }
.hero-particle:nth-child(8) { top: 40%; left: 92%; animation-delay: -2.4s; width: 3px; height: 3px; }
.hero-particle:nth-child(9) { top: 80%; left: 20%; animation-delay: -3s; }
@keyframes particleTwinkle {
    0%, 100% { opacity: 0; transform: scale(0); }
    50% { opacity: 0.9; transform: scale(1); }
}
.hero-ring {
    position: absolute;
    border: 1px solid rgba(102,126,234,0.2);
    border-radius: 50%;
    z-index: 0;
    animation: ringRotate 12s linear infinite;
}
.hero-ring:nth-child(10) {
    width: 400px; height: 400px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.hero-ring:nth-child(11) {
    width: 550px; height: 550px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-direction: reverse;
    animation-duration: 18s;
    border-color: rgba(118,75,162,0.15);
}
@keyframes ringRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
.hero > *:not(.hero-orb):not(.hero-particle):not(.hero-ring) {
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-size: 42px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #a8b4ff 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    letter-spacing: 2px;
}
.hero h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #00d2ff);
    margin: 16px auto 0;
    border-radius: 2px;
}
.hero p {
    font-size: 16px;
    opacity: 0.85;
    margin-bottom: 28px;
    color: rgba(255,255,255,0.85);
    letter-spacing: 1px;
}
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-btns .btn {
    position: relative;
    overflow: hidden;
}
.hero-btns .btn::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px;
    right: -2px; bottom: -2px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #00d2ff, #764ba2);
    z-index: -1;
    animation: btnGlow 3s ease-in-out infinite;
}
@keyframes btnGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}
.btn-primary { background: #fff; color: #1a1a4e; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(102,126,234,0.35); }
.btn-secondary { background: rgba(255,255,255,0.15); color: #fff; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }
.btn-purple { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.btn-tech {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
}
.btn-tech:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title .icon { font-size: 24px; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.tool-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.25s;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    display: block;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102,126,234,0.15);
    border-color: #667eea;
}
.tool-card .tool-icon { font-size: 40px; margin-bottom: 12px; }
.tool-card h3 { font-size: 18px; margin-bottom: 6px; }
.tool-card .desc { font-size: 13px; color: #999; margin-bottom: 12px; }
.tool-card .tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #f0f2ff;
    color: #667eea;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.plan-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    border: 2px solid #f0f0f0;
    text-align: center;
    transition: all 0.25s;
}
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.08); }
.plan-card.featured { border-color: #667eea; box-shadow: 0 4px 20px rgba(102,126,234,0.15); }
.plan-card .plan-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.plan-card .plan-price { font-size: 36px; font-weight: 800; color: #667eea; margin: 12px 0; }
.plan-card .plan-price span { font-size: 16px; font-weight: 400; color: #999; }
.plan-card .plan-features { text-align: left; padding: 20px 0; border-top: 1px solid #f0f0f0; margin-top: 16px; }
.plan-card .plan-features li {
    list-style: none;
    padding: 6px 0;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}
.plan-card .plan-features li::before { content: '\2713'; color: #4caf50; font-weight: 700; font-size: 16px; }
.plan-card button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.2s;
}
.plan-card.featured button { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.plan-card.featured button:hover { opacity: 0.9; }
.plan-card button:not(.featured button) { background: #f5f5f5; color: #666; }
.plan-card button { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.plan-card button:hover { opacity: 0.9; }

.page { max-width: 800px; margin: 0 auto; }
.page-wide { max-width: 1200px; margin: 0 auto; }
.page-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
    border: 1px solid #f0f0f0;
}
.page-card h2 { font-size: 20px; margin-bottom: 20px; color: #333; }

.input-group { margin-bottom: 16px; }
.input-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #666; font-weight: 500; }
.input-group input, .input-group textarea, .input-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.input-group textarea { resize: vertical; min-height: 100px; }
.input-group input:focus, .input-group textarea:focus { border-color: #667eea; }

.btn-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    transition: all 0.2s;
}
.btn-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.result-box {
    margin-top: 20px;
    padding: 24px;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #e0e2f5;
}
.result-box img { max-width: 100%; border-radius: 8px; margin-top: 12px; }
.result-box video { max-width: 100%; border-radius: 8px; margin-top: 12px; }
.result-box pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.8;
    color: #444;
}

.tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #f0f0f0; }
.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #999;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tab.active { color: #667eea; border-bottom-color: #667eea; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.login-card h2 { text-align: center; margin-bottom: 28px; font-size: 24px; color: #333; }
.login-card .form-group { margin-bottom: 18px; }
.login-card .form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #666; font-weight: 500; }
.login-card .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.login-card .form-group input:focus { border-color: #667eea; }
.login-card .form-group button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    transition: opacity 0.2s;
}
.login-card .form-group button:hover { opacity: 0.9; }
.login-card .form-group button:disabled { opacity: 0.5; cursor: not-allowed; }

.message { padding: 10px; border-radius: 8px; font-size: 14px; margin-top: 12px; text-align: center; display: none; }
.message.success { display: block; background: #e8f5e9; color: #2e7d32; }
.message.error { display: block; background: #ffebee; color: #c62828; }

.profile-info { display: flex; align-items: center; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #f0f0f0; margin-bottom: 20px; }
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    flex-shrink: 0;
}
.profile-detail h3 { font-size: 18px; }
.profile-detail p { font-size: 13px; color: #999; margin-top: 4px; }
.profile-stats { display: flex; gap: 24px; margin-top: 16px; }
.profile-stat { text-align: center; }
.profile-stat .val { font-size: 24px; font-weight: 700; color: #667eea; }
.profile-stat .lbl { font-size: 12px; color: #999; margin-top: 4px; }

.record-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.record-table th { text-align: left; padding: 10px 12px; color: #999; font-weight: 500; border-bottom: 1px solid #f0f0f0; }
.record-table td { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; }
.record-table .tool-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.tag-watermark { background: #e3f2fd; color: #1976d2; }
.tag-ai_watermark { background: #e8f5e9; color: #2e7d32; }
.tag-ali_logo_remove { background: #fff3e0; color: #e65100; }
.tag-ai_text { background: #f3e5f5; color: #7b1fa2; }
.tag-ai_image { background: #fce4ec; color: #c62828; }
.tag-convert { background: #e8f5e9; color: #00897b; }

.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state .empty-icon { font-size: 60px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; }

.size-options { display: flex; gap: 8px; margin-top: 8px; }
.size-option {
    padding: 6px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.size-option.active { border-color: #667eea; background: #f0f2ff; color: #667eea; }

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    animation: slideDown 0.3s ease;
}
.toast.success { background: #4caf50; color: #fff; }
.toast.error { background: #f44336; color: #fff; }

@keyframes slideDown {
    from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
    .hero { padding: 40px 16px; }
    .hero h1 { font-size: 24px; }
    .tools-grid, .plans-grid { grid-template-columns: 1fr; }
    .login-card { width: 90%; padding: 24px; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

.site-footer {
    background: #1a1a2e;
    color: #ccc;
    margin-top: 60px;
    padding: 50px 20px 30px;
}

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

.footer-cols {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #2a2a4a;
}

.footer-col h4 {
    font-size: 16px;
    color: #fff;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-col p {
    font-size: 13px;
    line-height: 1.8;
    color: #999;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    padding: 4px 0;
    font-size: 13px;
    color: #999;
}

.footer-col ul li a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: #667eea;
}

.footer-bottom {
    padding-top: 24px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

.footer-bottom p {
    margin-bottom: 6px;
}

.task-list {
    margin-top: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.task-processing {
    background: #fff8e1;
    border: 1px solid #ffe082;
}

.task-done {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    opacity: 0.8;
}

.task-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.task-info {
    flex: 1;
    min-width: 0;
}

.task-prompt {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: #999;
}

.task-status {
    font-weight: 600;
    color: #e65100;
}

.task-done .task-status {
    color: #2e7d32;
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: scaleIn 0.2s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}
.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    line-height: 1;
}
.modal-close:hover { color: #333; }
.modal-body { padding: 16px 24px; }
.modal-footer {
    padding: 12px 24px 20px;
    display: flex;
    justify-content: flex-end;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Topup cards */
.topup-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.topup-card:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}
.topup-card-left { display: flex; flex-direction: column; gap: 2px; }
.topup-points {
    font-size: 24px;
    font-weight: 700;
    color: #e65100;
}
.topup-points span { font-size: 14px; font-weight: 400; color: #999; }
.topup-price {
    font-size: 14px;
    color: #666;
}
.topup-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.topup-discount {
    display: inline-block;
    background: #ffebee;
    color: #d32f2f;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}
.topup-remarks {
    font-size: 11px;
    color: #999;
}

/* ===== Tech Stats Section ===== */
.tech-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 50px;
}
.tech-stat-card {
    background: linear-gradient(135deg, rgba(15,12,41,0.05), rgba(102,126,234,0.08));
    border: 1px solid rgba(102,126,234,0.15);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.tech-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #00d2ff);
    opacity: 0;
    transition: opacity 0.3s;
}
.tech-stat-card:hover::before { opacity: 1; }
.tech-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(102,126,234,0.15);
    border-color: rgba(102,126,234,0.3);
}
.tech-stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}
.tech-stat-number {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}
.tech-stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 6px;
}

/* ===== Tech Features Grid ===== */
.tech-features {
    margin-bottom: 40px;
}
.tech-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}
.tech-feature-card {
    background: linear-gradient(135deg, #fff, #f8f9ff);
    border: 1px solid rgba(102,126,234,0.12);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    cursor: default;
}
.tech-feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(102,126,234,0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
}
.tech-feature-card:hover::after { opacity: 1; }
.tech-feature-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(102,126,234,0.18);
    border-color: rgba(102,126,234,0.3);
}
.tech-feature-icon {
    font-size: 36px;
    margin-bottom: 14px;
    display: block;
    position: relative;
    z-index: 1;
}
.tech-feature-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a4e;
    position: relative;
    z-index: 1;
}
.tech-feature-card p {
    font-size: 13px;
    color: #999;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}
.tech-feature-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

/* Section subtitle */
.section-subtitle {
    font-size: 13px;
    color: #999;
    margin-top: -16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .tech-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .tech-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .tech-stat-number { font-size: 24px; }
    .tech-features-grid { grid-template-columns: 1fr 1fr; }
    .hero { padding: 50px 16px; }
    .hero h1 { font-size: 28px; }
}

/* ===== Feedback Floating Button ===== */
.feedback-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.feedback-float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(102,126,234,0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feedback-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(102,126,234,0.55);
}
.feedback-float-label {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

/* ===== Feedback Modal ===== */
.feedback-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}
.feedback-modal.show { display: flex; }
.feedback-modal-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: scaleIn 0.2s ease;
    max-height: 90vh;
    overflow-y: auto;
}
.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}
.feedback-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}
.feedback-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
    line-height: 1;
}
.feedback-modal-close:hover { color: #333; }
.feedback-modal-body { padding: 20px 24px; }
.feedback-modal-body .input-group { margin-bottom: 16px; }
.feedback-modal-body .input-group label { display: block; margin-bottom: 6px; font-size: 14px; color: #666; font-weight: 500; }
.feedback-modal-body .input-group input,
.feedback-modal-body .input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}
.feedback-modal-body .input-group textarea { resize: vertical; min-height: 100px; }
.feedback-modal-body .input-group input:focus,
.feedback-modal-body .input-group textarea:focus { border-color: #667eea; }

/* ===== Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Global Refinements ===== */
::selection {
    background: rgba(102,126,234,0.2);
    color: #1a1a4e;
}

html {
    /* 移除 smooth-scroll 避免滚动锚定异常跳動 */
}

a {
    transition: color 0.2s;
}

.page-card {
    transition: box-shadow 0.3s, transform 0.2s;
}
.page-card:hover {
    box-shadow: 0 8px 28px rgba(102,126,234,0.08);
}

@media (max-width: 640px) {
    .main {
        padding: 16px 12px;
    }
    .footer-cols {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .section-title {
        font-size: 18px;
    }
}

/* ===== Sign-In Modal ===== */
.signin-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}
.signin-overlay.show { display: flex; }
.signin-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: scaleIn 0.3s ease;
    overflow: hidden;
}
.signin-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 28px 24px 20px;
    text-align: center;
    color: #fff;
    position: relative;
}
.signin-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 1px;
}
.signin-header p {
    font-size: 12px;
    opacity: 0.7;
    letter-spacing: 2px;
}
.signin-header .signin-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.signin-header .signin-close:hover { background: rgba(255,255,255,0.3); }
.signin-body {
    padding: 20px 24px 24px;
    text-align: center;
}
.signin-streak {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}
.signin-streak strong {
    color: #667eea;
    font-size: 20px;
    font-weight: 700;
}
.signin-progress {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 24px;
    position: relative;
}
.signin-progress::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 18px;
    right: 18px;
    height: 2px;
    background: #f0f0f0;
    z-index: 0;
}
.signin-progress.has-progress::before {
    background: linear-gradient(90deg, #667eea, #764ba2);
}
.signin-day {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}
.signin-day-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s;
}
.signin-day.active .signin-day-dot {
    background: #667eea;
    box-shadow: 0 0 6px rgba(102,126,234,0.3);
}
.signin-day.today .signin-day-dot {
    width: 10px;
    height: 10px;
    background: #ccc;
}
.signin-day.today.active .signin-day-dot {
    background: #667eea;
}
.signin-day-label {
    font-size: 10px;
    color: #bbb;
}
.signin-day.active .signin-day-label {
    color: #667eea;
}
.signin-day-reward {
    font-size: 9px;
    color: #ddd;
}
.signin-day.active .signin-day-reward {
    color: #667eea;
}
.signin-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    transition: all 0.2s;
    letter-spacing: 2px;
}
.signin-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 16px rgba(102,126,234,0.3);
}
.signin-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
}
.signin-btn.signin-done {
    background: linear-gradient(135deg, #43a047, #66bb6a);
}
.signin-total {
    font-size: 11px;
    color: #ccc;
    margin-top: 14px;
}
.signin-total strong { color: #999; }

/* ===== Manual Sign-In Button ===== */
.btn-signin {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-signin:hover { opacity: 0.9; }

/* ===================================================================
   H5 移动端全局兼容优化
   =================================================================== */

/* Safe area insets for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .nav { padding-top: env(safe-area-inset-top); }
    .feedback-float { bottom: calc(30px + env(safe-area-inset-bottom)); }
    .modal-content { margin-bottom: env(safe-area-inset-bottom); }
}

/* Prevent iOS zoom on input focus */
input, textarea, select {
    font-size: 16px !important;
}

/* Better touch targets */
@media (pointer: coarse) {
    .nav-links a, .btn, .tab, .tool-card, .size-option,
    .filter-bar-modern .filter-btn, .topup-card,
    .feedback-float-btn, .modal-close, .feedback-modal-close,
    .signin-close, .profile-tab, .btn-copy, .btn-copy-outline {
        min-height: 44px;
    }
    .nav-links a, .tab, .profile-tab, .filter-bar-modern .filter-btn {
        display: flex;
        align-items: center;
    }
}

/* ===== Responsive: < 768px (tablets & large phones) ===== */
@media (max-width: 768px) {
    .hero { padding: 50px 16px; }
    .hero h1 { font-size: 28px; }
    .tools-grid, .plans-grid { grid-template-columns: 1fr; }
    .login-card { width: 90%; padding: 24px; }
    .footer-cols { grid-template-columns: 1fr 1fr; }

    /* 移动端表格水平滚动 */
    .record-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* 改进的移动端 Hero */
    .hero h1 { font-size: 26px; letter-spacing: 1px; }
    .hero p { font-size: 14px; }
    .hero-btns .btn { padding: 10px 20px; font-size: 14px; }
    .hero-orb:nth-child(1) { width: 180px; height: 180px; }
    .hero-orb:nth-child(2) { width: 150px; height: 150px; }

    /* 个人中心横幅适配 */
    .profile-banner { padding: 24px 20px; border-radius: 16px; }
    .profile-banner-content { flex-direction: column; text-align: center; gap: 16px; }
    .profile-banner-stats { justify-content: center; gap: 20px; }
    .profile-banner-info h2 { font-size: 20px; }
    .profile-banner-avatar { width: 64px; height: 64px; font-size: 28px; }
    .profile-banner-stat .val { font-size: 22px; }

    /* Profile tabs scrollable */
    .profile-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .profile-tabs::-webkit-scrollbar { display: none; }
    .profile-tab { padding: 14px 16px; font-size: 13px; flex-shrink: 0; }
    .profile-tab-content { padding: 16px; }
    .filter-bar-modern {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    .filter-bar-modern::-webkit-scrollbar { display: none; }
    .filter-bar-modern .filter-btn { flex-shrink: 0; }

    /* Pagination on mobile */
    .pagination-modern {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .pagination-modern .page-info {
        width: 100%;
        justify-content: center;
    }
    .pagination-modern .page-btns {
        flex-wrap: wrap;
        justify-content: center;
    }
    .pagination-modern .page-btn {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }

    /* AI / 工具箱页面 tabs */
    .page-card { padding: 20px; }
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tab { padding: 10px 14px; font-size: 13px; flex-shrink: 0; }

    /* 邀请页面适配 */
    .invite-hero { padding: 28px 20px; border-radius: 18px; }
    .invite-hero h2 { font-size: 22px; }
    .invite-code-section { flex-direction: column; align-items: stretch; text-align: center; gap: 12px; padding: 16px; }
    .invite-code-value { font-size: 18px; letter-spacing: 2px; }
    .invite-rules { gap: 12px; }

    /* 工具箱 watermark grid */
    .watermark-grid { grid-template-columns: 1fr !important; }

    /* 图片相关 */
    .size-options { flex-wrap: wrap; }

    /* 充值弹窗适配 */
    .topup-card { padding: 14px 16px; }
    .topup-points { font-size: 20px; }

    /* 任务列表 */
    .task-item { padding: 10px 12px; }

    /* Chat 页面适配 */
    .chat-container { border-radius: 0 !important; }

    /* 水印相关 */
    .watermark-grid { grid-template-columns: 1fr !important; }
}

/* ===== Responsive: < 540px (small phones) ===== */
@media (max-width: 540px) {
    .main { padding: 12px 10px; }
    .hero { padding: 36px 14px; border-radius: 14px; margin-bottom: 24px; }
    .hero h1 { font-size: 22px; }
    .hero p { font-size: 13px; margin-bottom: 20px; }

    .section-title { font-size: 17px; }
    .tools-grid { gap: 12px; }
    .tool-card { padding: 20px 16px; }
    .tool-card .tool-icon { font-size: 32px; }
    .tool-card h3 { font-size: 16px; }

    .page-card { padding: 16px; border-radius: 12px; }
    .page-card h2 { font-size: 17px; }

    .input-group input, .input-group textarea, .input-group select {
        padding: 10px 14px;
        font-size: 16px;
    }
    .btn-submit { padding: 12px; font-size: 15px; }

    .profile-info { flex-direction: column; text-align: center; gap: 12px; }
    .profile-stats { justify-content: center; }
    .profile-detail h3 { font-size: 16px; }

    .tech-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tech-stat-card { padding: 20px 12px; }
    .tech-stat-number { font-size: 24px; }
    .tech-stat-label { font-size: 12px; }

    .tech-features-grid { grid-template-columns: 1fr; gap: 12px; }
    .tech-feature-card { padding: 20px 16px; }

    .plans-grid { gap: 12px; }
    .plan-card { padding: 24px 16px; }
    .plan-card .plan-name { font-size: 18px; }
    .plan-card .plan-price { font-size: 30px; }

    .login-card { padding: 20px; }
    .login-card h2 { font-size: 20px; margin-bottom: 20px; }

    .site-footer { padding: 30px 16px 20px; margin-top: 40px; }
    .footer-cols { grid-template-columns: 1fr; gap: 20px; }
    .footer-col h4 { font-size: 14px; }

    .modal-content { width: 95%; border-radius: 14px; }
    .modal-header { padding: 16px 18px 0; }
    .modal-header h3 { font-size: 16px; }
    .modal-body { padding: 12px 18px; }

    .signin-modal { width: 95%; }
    .signin-header { padding: 24px 20px 16px; }
    .signin-header h2 { font-size: 16px; }
    .signin-body { padding: 16px 18px 20px; }
    .signin-progress { gap: 2px; }
    .signin-day-label { font-size: 9px; }

    .feedback-modal-content { width: 95%; }
    .feedback-modal-header { padding: 16px 18px 0; }
    .feedback-modal-body { padding: 14px 18px; }

    .feedback-float { bottom: 16px; right: 16px; }
    .feedback-float-btn { width: 48px; height: 48px; font-size: 20px; }
    .feedback-float-label { display: none; }

    /* Confirmation dialog mobile */
    .confirm-box { padding: 24px 20px 20px; width: 92%; }
    .confirm-box .confirm-icon { font-size: 40px; }
    .confirm-box .confirm-title { font-size: 16px; }
    .confirm-box .confirm-btns { flex-direction: column; gap: 8px; }
    .confirm-box .confirm-btns button { width: 100%; padding: 12px; font-size: 15px; }

    /* Empty state mobile */
    .empty-state-modern { padding: 40px 16px; }
    .empty-state-modern .empty-icon { font-size: 48px; }

    /* Profile content card mobile */
    .profile-content-card { border-radius: 12px; }
    .profile-tab { padding: 12px 14px; font-size: 12px; }

    .toast { top: 12px; padding: 10px 18px; font-size: 13px; max-width: 90%; }

    /* 邀请页面 */
    .invite-hero { padding: 24px 16px; }
    .invite-hero h2 { font-size: 20px; }
    .invite-rule-card { padding: 18px 14px; }
    .invite-rule-card .rule-icon { font-size: 28px; }
    .invite-rule-card .rule-highlight { font-size: 22px; }
    .invite-code-value { font-size: 16px; }

    /* AI 页 */
    .result-box { padding: 16px; }
    .profile-banner { padding: 20px 16px; }
    .profile-banner-avatar { width: 56px; height: 56px; font-size: 24px; }
    .profile-banner-info h2 { font-size: 18px; }
    .profile-banner-stat .val { font-size: 20px; }

    /* Chat 页面 */
    .chat-header { padding: 14px 16px !important; }
    .chat-header h2 { font-size: 16px !important; }
    .chat-messages { padding: 12px !important; }
    .chat-input-area { padding: 10px 12px !important; }

    /* 弹窗遮罩 - 防止底部被切 */
    .modal-overlay { align-items: flex-end; }
    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
    .feedback-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }
    .signin-modal { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; }
}

/* ===== 图片和媒体响应式 ===== */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* Lightbox mobile fix */
@media (max-width: 540px) {
    .lightbox-overlay .lightbox-content img {
        width: 95% !important;
        max-width: 95% !important;
    }
}