/* ========================================
   兴趣搭子H5 - 主样式表（粉色恋爱主题）
   版本: v20260512c
   主题: 温暖粉色系
   ======================================== */

/* CSS自定义属性（变量） */
:root {
    /* 主色调 */
    --primary: #E91E63;
    --primary-light: #FF8FAB;
    --primary-dark: #C2185B;
    --primary-bg: #FFF5F7;
    --primary-bg-light: #FFF0F3;
    --primary-bg-dark: #FFE8ED;
    
    /* 文本颜色 */
    --text-dark: #4A4A4A;
    --text-muted: #8B7B8B;
    --text-light: #B5A5B5;
    --text-white: #FFFFFF;
    
    /* 背景色 */
    --bg-main: #FFF5F7;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-overlay: rgba(255, 255, 255, 0.7);
    
    /* 边框 */
    --border-light: rgba(233, 30, 99, 0.1);
    --border-medium: rgba(233, 30, 99, 0.15);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(233, 30, 99, 0.08);
    --shadow-md: 0 2px 12px rgba(233, 30, 99, 0.06);
    --shadow-lg: 0 4px 20px rgba(233, 30, 99, 0.06);
    --shadow-xl: 0 4px 12px rgba(233, 30, 99, 0.25);
    
    /* 状态色 */
    --success: #4CAF50;
    --success-bg: rgba(76, 175, 80, 0.12);
    --warning: #FFC107;
    --warning-bg: rgba(255, 193, 7, 0.1);
    --error: #F44336;
    --error-bg: rgba(244, 67, 54, 0.1);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;
}

/* ========================================
   基础样式
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(180deg, var(--primary-bg) 0%, var(--primary-bg-light) 50%, var(--primary-bg-dark) 100%);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   通用工具类
   ======================================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 文本颜色 */
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

/* 背景 */
.bg-primary { background: var(--primary); }
.bg-white { background: var(--bg-card); }

/* Flex布局 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* ========================================
   按钮样式
   ======================================== */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: var(--text-white);
    box-shadow: var(--shadow-xl);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(233, 30, 99, 0.35);
}

.btn-secondary {
    background: rgba(245, 230, 236, 0.8);
    color: var(--text-muted);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ========================================
   卡片样式
   ======================================== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-light);
}

/* ========================================
   表单样式
   ======================================== */
input, textarea, select {
    font-family: inherit;
    font-size: 14px;
    padding: 12px 16px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-overlay);
    color: var(--text-dark);
    transition: border-color 0.3s ease;
    width: 100%;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--text-light);
}

/* ========================================
   徽章样式
   ======================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(255, 143, 171, 0.15);
    color: var(--primary);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: #E6A817;
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

/* ========================================
   标签样式
   ======================================== */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(255, 143, 171, 0.15);
    color: var(--primary);
}

.tag-success {
    background: rgba(76, 175, 80, 0.12);
    color: var(--success);
}

/* ========================================
   进度条
   ======================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #FFE4EC;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ========================================
   模态框
   ======================================== */
.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;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ========================================
   Toast提示
   ======================================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--text-dark);
    color: white;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--error);
}

@keyframes toastIn {
    from { top: -50px; opacity: 0; }
    to { top: 20px; opacity: 1; }
}

@keyframes toastOut {
    from { top: 20px; opacity: 1; }
    to { top: -50px; opacity: 0; }
}

/* ========================================
   加载动画
   ======================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 15px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.empty-state-desc {
    font-size: 13px;
}

/* ========================================
   底部导航（备用样式）
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(233, 30, 99, 0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    cursor: pointer;
}

.nav-icon {
    font-size: 20px;
    filter: grayscale(100%);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.nav-text {
    font-size: 11px;
    color: var(--text-muted);
}

.nav-item.active .nav-icon {
    filter: grayscale(0%);
    opacity: 1;
}

.nav-item.active .nav-text {
    color: var(--primary);
}

/* ========================================
   响应式调整
   ======================================== */
@media (max-width: 375px) {
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .card-body {
        padding: 12px;
    }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    .bottom-nav, .nav-item, .header-action {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ========================================
   Scrollbar样式（Webkit浏览器）
   ======================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(233, 30, 99, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(233, 30, 99, 0.4);
}

/* ========================================
   选中文本样式
   ======================================== */
::selection {
    background: rgba(233, 30, 99, 0.2);
    color: var(--primary-dark);
}
