/* ============================================================
   企业信息搜索 · 双休投票  —— 样式表
   设计语言：玻璃拟态 + 柔和渐变 + 圆角卡片，响应式
   ============================================================ */

:root {
    --bg: #0f1226;
    --bg-soft: #171a35;
    --card: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.12);
    --text: #eef0ff;
    --text-dim: #a6aad0;
    --text-faint: #7b7fa8;
    --primary: #6c7bff;
    --primary-soft: rgba(108, 123, 255, 0.18);
    --double: #2fd39b;        /* 双休 = 绿色 */
    --double-soft: rgba(47, 211, 155, 0.15);
    --not-double: #ff7a8a;    /* 非双休 = 红粉 */
    --not-double-soft: rgba(255, 122, 138, 0.15);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ---------- 背景装饰光斑 ---------- */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: float 18s ease-in-out infinite;
}
.blob-1 { width: 480px; height: 480px; background: #5b4bff; top: -120px; left: -80px; }
.blob-2 { width: 420px; height: 420px; background: #2fd39b; bottom: -140px; right: -60px; animation-delay: -6s; }
.blob-3 { width: 360px; height: 360px; background: #ff5c9e; top: 40%; left: 55%; opacity: 0.3; animation-delay: -12s; }
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.08); }
    66% { transform: translate(-30px, 25px) scale(0.95); }
}

/* ---------- 顶部栏 ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 32px;
    backdrop-filter: blur(12px);
    background: rgba(15, 18, 38, 0.6);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}
.logo-icon { font-size: 22px; }
.header-stats .stat-item {
    color: var(--text-dim);
    font-size: 14px;
}
.header-stats strong {
    color: var(--primary);
    font-size: 16px;
}

/* ---------- 容器 ---------- */
.container {
    max-width: 920px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ---------- 搜索英雄区 ---------- */
.search-hero {
    text-align: center;
    padding: 56px 0 28px;
}
.hero-title {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(120deg, #fff 20%, #a9b0ff 60%, #2fd39b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}
.hero-subtitle {
    color: var(--text-dim);
    font-size: 15px;
    margin-bottom: 28px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 999px;
    padding: 6px 6px 6px 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft), var(--shadow);
}
.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-faint);
    flex-shrink: 0;
}
#searchInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 16px;
    padding: 12px 14px;
}
#searchInput::placeholder { color: var(--text-faint); }
.search-btn {
    background: linear-gradient(120deg, var(--primary), #8a6cff);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.search-btn:hover { transform: translateY(-1px); filter: brightness(1.1); }
.search-btn:active { transform: translateY(0); }

/* ---------- 筛选栏 ---------- */
.filter-bar {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-group label {
    color: var(--text-dim);
    font-size: 13px;
}
.filter-group select {
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}
.filter-group select:focus { border-color: var(--primary); }

/* ---------- 结果区 ---------- */
.results-section { margin-top: 20px; }
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 16px;
    padding: 0 4px;
}
.results-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------- 企业卡片 ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px 24px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.card:hover {
    border-color: rgba(108, 123, 255, 0.4);
    transform: translateY(-2px);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.card-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    word-break: break-all;
}
.card-title .highlight {
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 4px;
    padding: 0 2px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 20px;
    margin-bottom: 4px;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--text-dim);
}
.meta-item .meta-label {
    color: var(--text-faint);
    flex-shrink: 0;
}
.meta-item .meta-value {
    color: var(--text);
    font-weight: 500;
    word-break: break-all;
}
.badge {
    display: inline-block;
    background: var(--primary-soft);
    color: #b9c0ff;
    border: 1px solid rgba(108, 123, 255, 0.3);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- 投票区：两个大框 ---------- */
.vote-area {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--card-border);
}
.vote-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.vote-label .q { font-weight: 600; color: var(--text); }

.vote-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.vote-box {
    position: relative;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    overflow: hidden;
    user-select: none;
}
.vote-box.double { background: var(--double-soft); border-color: rgba(47, 211, 155, 0.3); }
.vote-box.not_double { background: var(--not-double-soft); border-color: rgba(255, 122, 138, 0.3); }

.vote-box:hover:not(.disabled) {
    transform: translateY(-2px);
}
.vote-box.double:hover:not(.disabled) { border-color: var(--double); box-shadow: 0 6px 20px rgba(47, 211, 155, 0.25); }
.vote-box.not_double:hover:not(.disabled) { border-color: var(--not-double); box-shadow: 0 6px 20px rgba(255, 122, 138, 0.25); }

.vote-box.voted {
    cursor: default;
}
.vote-box.double.voted { border-color: var(--double); background: rgba(47, 211, 155, 0.22); }
.vote-box.not_double.voted { border-color: var(--not-double); background: rgba(255, 122, 138, 0.22); }
.vote-box.disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.vote-box-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}
.vote-emoji { font-size: 20px; }
.vote-name {
    font-size: 15px;
    font-weight: 700;
}
.vote-box.double .vote-name { color: var(--double); }
.vote-box.not_double .vote-name { color: var(--not-double); }
.vote-check {
    margin-left: auto;
    font-size: 13px;
    color: var(--text-dim);
    opacity: 0;
    transition: var(--transition);
}
.vote-box.voted .vote-check { opacity: 1; }

.vote-numbers {
    display: flex;
    align-items: baseline;
    gap: 6px;
    position: relative;
    z-index: 2;
}
.vote-count {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.vote-pct {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 600;
}

/* 占比条 */
.vote-ratio-bar {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
}
.ratio-double { background: var(--double); transition: width 0.5s ease; }
.ratio-not { background: var(--not-double); transition: width 0.5s ease; }

/* 卡片底部的合计 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-faint);
}
.card-footer a {
    color: var(--text-faint);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-faint);
}
.card-footer a:hover { color: var(--primary); }

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.page-btn {
    background: var(--card);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--text); }
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- 空状态 / 加载 ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; font-size: 18px; }
.empty-state p { font-size: 14px; }

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
}
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 34, 66, 0.95);
    border: 1px solid var(--card-border);
    color: var(--text);
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--double); }
.toast.error { border-color: var(--not-double); }

/* ---------- 页脚 ---------- */
.site-footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-faint);
    font-size: 12px;
    border-top: 1px solid var(--card-border);
    max-width: 720px;
    margin: 0 auto;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .hero-title { font-size: 30px; }
    .site-header { padding: 14px 18px; }
    .logo-text { font-size: 16px; }
    .search-box { padding: 5px 5px 5px 16px; }
    .search-btn { padding: 11px 20px; }
    .vote-boxes { grid-template-columns: 1fr; }
    .card { padding: 18px; }
    .card-top { flex-direction: column; }
    .meta-grid { grid-template-columns: 1fr; }
}
