/* ========================================
   测姻缘 - 公共样式文件
   ======================================== */

/* CSS变量定义 */
:root {
    /* 主题色 */
    --primary-color: #ff6b6b;
    --primary-dark: #d63031;
    --primary-light: #ff7675;

    /* 渐变色 */
    --gradient-red: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 50%, #d63031 100%);
    --gradient-pink: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    --gradient-gold: linear-gradient(135deg, #f6d365 0%, #fda085 100%);

    /* 文字颜色 */
    --text-white: #ffffff;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;

    /* 背景色 */
    --bg-light: #fafafa;
    --bg-cream: #fff9f0;
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(214, 48, 49, 0.1);
    --shadow-md: 0 4px 16px rgba(214, 48, 49, 0.15);
    --shadow-lg: 0 8px 32px rgba(214, 48, 49, 0.2);
    --shadow-btn: 0 4px 20px rgba(214, 48, 49, 0.4);

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-full: 50%;

    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-red);
    min-height: 100vh;
    color: var(--text-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   通用容器
   ======================================== */

.page-container {
    max-width: 750px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

.page-content {
    padding-bottom: 100px;
}

/* ========================================
   头部导航
   ======================================== */

.header {
    padding: var(--spacing-md) var(--spacing-lg);
    padding-top: max(env(safe-area-inset-top), var(--spacing-md));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-back {
    position: absolute;
    left: var(--spacing-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background 0.3s;
}

.header-back:active {
    background: rgba(255, 255, 255, 0.3);
}

.header-back svg {
    width: 24px;
    height: 24px;
    fill: var(--text-white);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-white);
}

/* ========================================
   底部导航栏
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #ffffff 100%);
    padding: var(--spacing-sm) var(--spacing-md);
    padding-bottom: max(env(safe-area-inset-bottom), var(--spacing-sm));
    display: flex;
    justify-content: space-around;
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-gray);
    font-size: 11px;
    padding: var(--spacing-xs);
    transition: color 0.3s;
}

.bottom-nav-item:active {
    color: var(--primary-color);
}

.bottom-nav-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.bottom-nav-text {
    white-space: nowrap;
}

/* ========================================
   首页内容
   ======================================== */

.home-hero {
    padding: var(--spacing-xxl) var(--spacing-lg);
    text-align: center;
}

.home-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.home-logo-icon {
    width: 80px;
    height: 80px;
    font-size: 48px;
}

.home-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: 4px;
}

.home-subtitle {
    font-size: 16px;
    opacity: 0.9;
    letter-spacing: 2px;
}

.home-btn-container {
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
}

/* ========================================
   按钮样式
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-white);
    background: var(--gradient-red);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: var(--shadow-btn);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:active::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(214, 48, 49, 0.3);
}

.btn-primary {
    width: 80%;
    max-width: 300px;
    height: 56px;
    margin: 0 auto;
    display: flex;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    font-size: 14px;
}

.btn-secondary::before {
    display: none;
}

/* 脉冲动画按钮 */
.btn-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* 弹跳动画按钮 */
.btn-bounce {
    animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 闪烁动画按钮 */
.btn-shine {
    animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* ========================================
   表单样式
   ======================================== */

.form-container {
    padding: var(--spacing-lg);
}

.form-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 14px;
    margin-bottom: var(--spacing-sm);
    opacity: 0.9;
}

.form-input {
    width: 100%;
    height: 50px;
    padding: 0 var(--spacing-md);
    font-size: 16px;
    color: var(--text-dark);
    background: var(--text-white);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--primary-light);
}

.form-input::placeholder {
    color: var(--text-light);
}

/* 性别选择 */
.gender-select {
    display: flex;
    gap: var(--spacing-md);
}

.gender-option {
    flex: 1;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-white);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dark);
    font-size: 16px;
    border: 2px solid transparent;
}

.gender-option.selected {
    background: var(--text-white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.gender-option:active {
    transform: scale(0.98);
}

/* 日期选择 */
.date-input {
    color-scheme: dark;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

/* ========================================
   结果页面
   ======================================== */

.result-container {
    padding: var(--spacing-lg);
    text-align: center;
}

.result-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--spacing-lg);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.result-desc {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.8;
}

.result-btn-container {
    padding: var(--spacing-lg);
}

/* ========================================
   支付页面
   ======================================== */

.payment-container {
    padding: var(--spacing-lg);
}

.payment-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.payment-amount {
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.payment-amount-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.payment-amount-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--gradient-gold);
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.payment-method {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.payment-method.selected {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--text-white);
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    margin-right: var(--spacing-md);
}

.payment-method-name {
    flex: 1;
    font-size: 16px;
}

.payment-method-check {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-method.selected .payment-method-check {
    background: var(--text-white);
    border-color: var(--text-white);
}

.payment-method-check svg {
    width: 14px;
    height: 14px;
    fill: var(--primary-color);
    opacity: 0;
}

.payment-method.selected .payment-method-check svg {
    opacity: 1;
}

.payment-btn-container {
    padding: var(--spacing-lg);
}

/* ========================================
   弹窗
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 85%;
    max-width: 340px;
    background: var(--text-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-dark);
}

.modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--spacing-md);
    background: #fff3e0;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.modal-desc {
    font-size: 14px;
    color: var(--text-gray);
}

.modal-body {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
}

.modal-btn-group {
    display: flex;
    gap: var(--spacing-md);
}

.modal-btn {
    flex: 1;
    height: 48px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.modal-btn-cancel {
    background: #f5f5f5;
    color: var(--text-gray);
}

.modal-btn-cancel:active {
    background: #eeeeee;
}

.modal-btn-confirm {
    background: var(--gradient-red);
    color: var(--text-white);
}

.modal-btn-confirm:active {
    opacity: 0.9;
}

/* ========================================
   列表页
   ======================================== */

.list-container {
    padding: var(--spacing-lg);
}

.list-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.list-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--text-white);
    transition: background 0.3s;
    border-radius: var(--radius-md);
}

.list-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.list-item-icon {
    width: 44px;
    height: 44px;
    margin-right: var(--spacing-md);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 16px;
    margin-bottom: 2px;
}

.list-item-desc {
    font-size: 12px;
    opacity: 0.7;
}

.list-item-arrow {
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.list-item-arrow svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* ========================================
   协议页
   ======================================== */

.agreement-container {
    padding: var(--spacing-lg);
}

.agreement-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.agreement-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.agreement-content {
    font-size: 14px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.9);
}

.agreement-content h3 {
    font-size: 16px;
    margin: var(--spacing-lg) 0 var(--spacing-sm);
}

.agreement-content p {
    margin-bottom: var(--spacing-md);
}

/* ========================================
   空状态
   ======================================== */

.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    opacity: 0.7;
}

/* ========================================
   输入框提示文字
   ======================================== */

::-webkit-input-placeholder {
    color: #bbb !important;
}

/* ========================================
   动画效果
   ======================================== */

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* 延迟动画 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ========================================
   滚动条样式
   ======================================== */

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* ========================================
   工具类
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

/* ========================================
   移动端安全区域
   ======================================== */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(env(safe-area-inset-bottom) + var(--spacing-sm));
    }
}
