* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

*:focus {
    outline: none;
}

*:active {
    outline: none;
}

:root {
    --primary-color: #0066CC;
    --bg-color: #000000;
    --card-bg: #000000;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --border-color: #38383a;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 100px;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('image.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}



/* 搜索区域 */
.search-filter-container {
    margin: 20px;
    margin-top: 40px;
    padding: 20px;
    background: transparent;
    border: none;
    border-radius: 16px;
    box-shadow: none;
}

.search-form {
    width: 100%;
    margin-bottom: 0;
}

.search-box {
    display: flex;
    align-items: center;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000000;
    transition: all 0.3s;
}

.search-input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 状态提示 */
.status-message {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s;
}

.status-message.show {
    opacity: 1;
    height: auto;
}

.status-message.success {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

.status-message.error {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

.status-message.info {
    background: rgba(10, 132, 255, 0.15);
    color: #0a84ff;
}

/* 筛选栏 */
.filter-bar {
    margin-top: 16px;
    padding-top: 16px;
    border-top: none;
    padding: 16px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filter-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.filter-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.filter-row {
    margin-bottom: 16px;
}

.filter-row label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.gender-buttons {
    display: flex;
    gap: 8px;
}

.gender-btn {
    flex: 1;
    padding: 8px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gender-btn.active {
    background: var(--primary-color);
    border: none;
    color: #ffffff;
}

.filter-input {
    width: 100%;
    padding: 8px 10px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.filter-input:focus {
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-reset {
    width: 100%;
    padding: 8px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 8px;
}

/* 结果区域 */
.result-area {
    padding: 0 20px 80px;
    display: block !important;
    visibility: visible !important;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-summary {
    padding: 16px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.5);
}

.category-header {
    background: transparent;
    color: #ffffff;
    padding: 12px 0;
    border-radius: 0;
    font-size: 15px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--border-color);
}

.record-item {
    padding: 16px;
    border-radius: 16px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    display: block !important;
    visibility: visible !important;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.record-item:nth-child(1) { animation-delay: 0.1s; }
.record-item:nth-child(2) { animation-delay: 0.15s; }
.record-item:nth-child(3) { animation-delay: 0.2s; }
.record-item:nth-child(4) { animation-delay: 0.25s; }
.record-item:nth-child(5) { animation-delay: 0.3s; }
.record-item:nth-child(n+6) { animation-delay: 0.35s; }

.record-number {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
}

.record-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-line {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.field-line:last-child {
    border-bottom: none;
}

.field-label {
    min-width: 80px;
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.field-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-all;
}

.record-item.hidden {
    display: none;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: none;
    z-index: 1000;
}

.loading-overlay.active {
    display: block;
}

.loading-text-inline {
    margin-top: 12px;
    font-size: 14px;
    color: #ffffff;
    text-align: center;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s;
}

.loading-text-inline.active {
    opacity: 1;
    height: auto;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    box-shadow: var(--shadow-hover);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* 响应式优化 */
@media (min-width: 768px) {
    .search-filter-container,
    .result-area {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* iOS 安全区域适配 */
@supports (padding: max(0px)) {
    body {
        padding-bottom: max(60px, env(safe-area-inset-bottom));
    }
    
    .back-to-top {
        bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
}

/* 欢迎弹窗 */
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.welcome-modal.hidden {
    display: none;
}

.welcome-content {
    background: #000000;
    border-radius: 20px;
    padding: 32px 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.1s;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: bounce 0.6s ease 0.5s;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.welcome-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.welcome-qr {
    margin: 24px 0;
}

.qr-placeholder {
    display: inline-block;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.qr-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.welcome-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.welcome-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-btn-primary {
    background: var(--primary-color);
    color: white;
}

.welcome-btn-secondary {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}



.search-box:focus-within {
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-status-message {
    margin-top: 12px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s;
}

.filter-status-message.show {
    opacity: 1;
    height: auto;
}

.filter-status-message.success {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

.filter-status-message.error {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

.filter-status-message.info {
    background: rgba(10, 132, 255, 0.15);
    color: #0a84ff;
}

.record-item.hidden {
    display: none !important;
}
