/* =====================================================
   婚礼预算计算器 - 样式表
   ===================================================== */

/* CSS Variables */
:root {
    /* 婚礼主题色 */
    --primary-color: #E74C8B;
    --primary-light: #FF6B9D;
    --primary-dark: #C4326F;
    --secondary-color: #FFD700;
    --accent-color: #FF69B4;
    
    /* 中性色 */
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --bg-primary: #FFF5F8;
    --bg-white: #FFFFFF;
    --bg-card: rgba(255, 255, 255, 0.95);
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #FF6B9D 0%, #E74C8B 50%, #C4326F 100%);
    --gradient-gold: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    --gradient-bg: linear-gradient(135deg, #FFF5F8 0%, #FFE4EC 50%, #FFF0F5 100%);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(231, 76, 139, 0.1);
    --shadow-md: 0 4px 20px rgba(231, 76, 139, 0.15);
    --shadow-lg: 0 10px 40px rgba(231, 76, 139, 0.2);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50px;
    
    /* 过渡 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--gradient-bg);
    background-attachment: fixed;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/background.png') center/cover no-repeat;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 0 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 15s infinite linear;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    padding: 5px;
    box-shadow: var(--shadow-md);
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

/* Main Content */
.main-content {
    padding: 30px 0;
    margin-top: -30px;
    position: relative;
    z-index: 1;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(231, 76, 139, 0.2);
}

.section-title .icon {
    font-size: 1.8rem;
}

/* Calculator Form */
.calculator-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px 16px 45px;
    font-size: 1.2rem;
    border: 2px solid #E8E8E8;
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
    background: white;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(231, 76, 139, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--text-light);
}

/* Tier Options */
.tier-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.tier-option {
    cursor: pointer;
}

.tier-option input {
    display: none;
}

.tier-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: white;
    border: 2px solid #E8E8E8;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.tier-option input:checked + .tier-card {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #FFF5F8 0%, #FFE4EC 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 139, 0.2);
}

.tier-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
}

.tier-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.tier-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.tier-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    margin-top: 10px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.3rem;
}

/* Results */
.results-container {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 2px dashed rgba(231, 76, 139, 0.2);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.results-table-wrapper {
    overflow-x: auto;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table th,
.results-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #F0F0F0;
}

.results-table th {
    background: linear-gradient(135deg, #FFF5F8 0%, #FFE4EC 100%);
    font-weight: 700;
    color: var(--primary-dark);
}

.results-table tbody tr {
    transition: background var(--transition-fast);
}

.results-table tbody tr:hover {
    background: #FFF5F8;
}

.results-table .item-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-table .item-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.results-table .amount {
    font-weight: 700;
    color: var(--primary-color);
}

.results-table tfoot .total-row {
    background: var(--gradient-primary);
    color: white;
}

.results-table tfoot .total-row td {
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: none;
}

.chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-wrapper canvas {
    max-width: 100%;
    height: auto;
}

.results-tips {
    margin-top: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF5CC 100%);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--secondary-color);
}

.results-tips .tip {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Formula Section */
.formula-content {
    text-align: center;
}

.formula-box {
    background: linear-gradient(135deg, #FFF5F8 0%, #FFE4EC 100%);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
}

.formula-main {
    margin-bottom: 15px;
}

.formula-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: "Courier New", monospace;
    background: white;
    padding: 15px 30px;
    border-radius: var(--radius-md);
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.formula-example {
    color: var(--text-secondary);
    font-size: 1rem;
}

.ratios-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.ratios-table-wrapper {
    overflow-x: auto;
}

.ratios-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ratios-table th,
.ratios-table td {
    padding: 14px 16px;
    text-align: center;
    border: 1px solid #F0F0F0;
}

.ratios-table th {
    background: linear-gradient(135deg, #FFF5F8 0%, #FFE4EC 100%);
    font-weight: 700;
    color: var(--primary-dark);
}

.ratios-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.ratios-table tbody tr:hover {
    background: #FFF5F8;
}

.item-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Examples Section */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.example-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 25px;
    border: 1px solid #F0F0F0;
    transition: all var(--transition-fast);
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.example-card.featured {
    border: 2px solid var(--primary-color);
    position: relative;
}

.example-card.featured::before {
    content: '推荐';
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
}

.example-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #F0F0F0;
}

.example-icon {
    font-size: 1.5rem;
}

.example-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.example-budget {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.example-budget strong {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.example-list {
    list-style: none;
    font-size: 0.9rem;
}

.example-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #F0F0F0;
    color: var(--text-secondary);
}

.example-list li:last-child {
    border-bottom: none;
}

/* Details Section */
.details-content {
    display: grid;
    gap: 25px;
}

.detail-item {
    padding: 25px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid #F0F0F0;
    transition: all var(--transition-fast);
}

.detail-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.detail-item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.detail-item > p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.detail-item ul {
    list-style: none;
    margin-bottom: 15px;
}

.detail-item ul li {
    padding: 8px 0 8px 20px;
    position: relative;
    color: var(--text-secondary);
}

.detail-item ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.tip-text {
    font-size: 0.9rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, #FFF5F8 0%, #FFE4EC 100%);
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    margin: 0;
}

/* Ad Container */
.ad-container {
    margin: 25px 0;
    min-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Footer */
.footer {
    background: var(--gradient-primary);
    color: white;
    padding: 40px 0;
    margin-top: 30px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-links .divider {
    margin: 0 15px;
    opacity: 0.5;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-wrapper {
        order: -1;
        margin-bottom: 20px;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 30px 0 40px;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 20px;
        border-radius: var(--radius-md);
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .tier-options {
        grid-template-columns: 1fr;
    }
    
    .tier-card {
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .tier-icon {
        font-size: 1.8rem;
        margin-bottom: 0;
    }
    
    .tier-info {
        text-align: left;
    }
    
    .formula-text {
        font-size: 1.1rem;
        padding: 12px 20px;
    }
    
    .results-table th,
    .results-table td {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .ratios-table th,
    .ratios-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .detail-item {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    body::before {
        display: none;
    }
    
    .header {
        background: white;
        color: var(--text-primary);
        border-bottom: 2px solid var(--primary-color);
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .ad-container {
        display: none;
    }
    
    .calculate-btn {
        display: none;
    }
    
    .footer {
        background: white;
        color: var(--text-primary);
        border-top: 2px solid var(--primary-color);
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Number Animation */
.animate-number {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
