/* ============================================
   美国地址生成器 - 样式文件
   主色调：蓝色系 #2563eb
   ============================================ */

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-lighter: #eff6ff;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gray-900);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo-img {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--gray-700);
    border-radius: 3px;
    transition: var(--transition);
}

/* ============================================
   Hero区域
   ============================================ */
.hero {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%);
    color: white;
    padding: 60px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: heroBgMove 20s linear infinite;
}

@keyframes heroBgMove {
    from { transform: translate(0, 0); }
    to { transform: translate(40px, 40px); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 40px;
    line-height: 1.7;
}

/* 生成器面板 */
.generator-panel {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.state-selector-wrapper {
    text-align: left;
}

.state-label {
    display: block;
    color: var(--gray-700);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.state-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    color: var(--gray-800);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.state-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.state-select option[data-taxfree="1"] {
    color: var(--success);
    font-weight: 600;
}

.generate-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 加载动画 */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 免税州提示 */
.tax-free-hint {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.85;
    flex-wrap: wrap;
}

.hint-badge {
    font-size: 1rem;
}

/* ============================================
   结果区域
   ============================================ */
.result-section {
    padding: 60px 20px;
    animation: fadeInUp 0.5s ease;
}

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

.result-container {
    max-width: 1200px;
    margin: 0 auto;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.result-header h2 {
    font-size: 1.75rem;
    color: var(--gray-900);
    font-weight: 700;
}

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

.action-btn {
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-btn.copy-all-btn {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.action-btn.copy-all-btn:hover {
    background: var(--primary-dark);
}

/* 结果卡片 */
.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.result-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.result-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-lighter), #f0f7ff);
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    font-size: 1.5rem;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.card-body {
    padding: 20px 24px;
}

/* 字段行 */
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 12px;
}

.field-row:last-child {
    border-bottom: none;
}

.field-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 500;
    flex-shrink: 0;
    min-width: 120px;
}

.field-value {
    font-size: 0.95rem;
    color: var(--gray-800);
    font-weight: 500;
    flex: 1;
    text-align: right;
    word-break: break-all;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

.copy-btn {
    background: var(--gray-100);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.copy-btn.copied {
    background: var(--success);
    color: white;
}

/* ============================================
   功能介绍区域
   ============================================ */
.features-section {
    padding: 80px 20px;
    background: white;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 48px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.feature-item {
    padding: 32px 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.7;
}

/* ============================================
   FAQ区域
   ============================================ */
.faq-section {
    padding: 80px 20px;
    background: var(--gray-50);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    padding: 18px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 1rem;
    user-select: none;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--primary-lighter);
}

.faq-toggle {
    font-size: 0.8rem;
    color: var(--primary);
    transition: var(--transition);
    flex-shrink: 0;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 24px 18px;
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ============================================
   免责声明
   ============================================ */
.disclaimer-section {
    padding: 80px 20px;
    background: #fef3c7;
}

.disclaimer-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    border-left: 4px solid var(--warning);
    box-shadow: var(--shadow-md);
}

.disclaimer-content p {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.disclaimer-content strong {
    color: var(--danger);
}

.disclaimer-warning {
    margin-top: 20px !important;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: var(--radius-sm);
    color: var(--danger) !important;
    font-weight: 600 !important;
    border: 1px solid #fecaca;
}

/* ============================================
   底部
   ============================================ */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 40px 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info p {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.footer-info p:last-child {
    font-size: 0.8rem;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

/* ============================================
   弹窗
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.modal-close {
    background: var(--gray-100);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--gray-600);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
}

.saved-item {
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--gray-100);
}

.saved-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.saved-item-title {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.95rem;
}

.saved-item-time {
    font-size: 0.8rem;
    color: var(--gray-400);
}

.saved-item-info {
    font-size: 0.85rem;
    color: var(--gray-500);
    line-height: 1.6;
}

.saved-item-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.saved-item-actions button {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.saved-item-actions button:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.saved-item-actions button.delete-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.saved-empty {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
    font-size: 1rem;
}

/* ============================================
   Toast提示
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .result-cards {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-actions {
        width: 100%;
    }

    .action-btn {
        flex: 1;
        text-align: center;
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .disclaimer-content {
        padding: 24px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .field-row {
        flex-wrap: wrap;
    }

    .field-label {
        min-width: auto;
        width: 100%;
    }

    .field-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 40px 16px 60px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .generator-panel {
        padding: 20px;
    }

    .generate-btn {
        font-size: 1rem;
        padding: 14px;
    }

    .result-section,
    .features-section,
    .faq-section,
    .disclaimer-section {
        padding: 40px 16px;
    }
}
