/* ============================================================
   问卷管理系统 - 糖糕云风格主题
   主色：绿色 #52c41a | 辅助：浅绿 #f6ffed
   设计风格：简洁现代、圆角、卡片式布局
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #52c41a;
    --primary-hover: #73d13d;
    --primary-dark: #389e0d;
    --primary-light: #f6ffed;
    --success: #389e0d;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text-main: #1f1f1f;
    --text-secondary: #595959;
    --text-light: #8c8c8c;
    --border: #d9d9d9;
    --border-light: #f0f0f0;
    --bg: #f5f7fa;
    --bg-white: #ffffff;
    --bg-hover: #f0f7e8;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(82, 196, 26, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ============ 顶部导航 ============ */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}
.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #b7eb8f 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}
.navbar-brand .logo-text { font-size: 18px; }
.navbar-menu { display: flex; gap: 32px; align-items: center; }
.navbar-menu a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 4px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.navbar-menu a:hover, .navbar-menu a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-main);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.5;
    white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #ff7875; border-color: #ff7875; color: #fff; }
.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover { background: #73d13d; border-color: #73d13d; color: #fff; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }

/* ============ 卡片 ============ */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
}
.card-body { padding: 24px; }

/* ============ 首页 Hero ============ */
.hero {
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 60%);
    padding: 80px 24px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero h1 {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.3;
}
.hero h1 .highlight {
    background: linear-gradient(90deg, var(--primary) 0%, #73d13d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}
.hero-features {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    margin-top: 60px;
}
.hero-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 30px;
    background: #fff;
    border-radius: var(--radius);
    min-width: 180px;
    box-shadow: var(--shadow-sm);
}
.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.hero-feature h3 { font-size: 16px; color: var(--text-main); font-weight: 600; }
.hero-feature p { font-size: 13px; color: var(--text-light); }

/* ============ 内容容器 ============ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}
.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.section-title h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
}
.section-title .desc { color: var(--text-light); margin-top: 8px; font-size: 14px; }

/* ============ 问卷列表 ============ */
.survey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.survey-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.survey-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.survey-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}
.survey-card .desc {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    min-height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.survey-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-light);
}
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #f6ffed; color: var(--success); border: 1px solid #b7eb8f; }
.badge-warning { background: #fffbe6; color: var(--warning); border: 1px solid #ffe58f; }
.badge-info { background: var(--primary-light); color: var(--primary); border: 1px solid #b7eb8f; }
.badge-danger { background: #fff2f0; color: var(--danger); border: 1px solid #ffccc7; }
.badge-default { background: #fafafa; color: var(--text-secondary); border: 1px solid var(--border); }

/* ============ 表单 ============ */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 14px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.1);
}
textarea.form-control { min-height: 80px; resize: vertical; }
.form-tip { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* ============ 入口页 ============ */
.entry-wrapper {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
}
.entry-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 48px;
    max-width: 560px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(82, 196, 26, 0.1);
}
.entry-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--text-main);
    text-align: center;
}
.entry-card .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
}
.entry-card .checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    cursor: pointer;
    user-select: none;
}
.entry-card .checkbox-wrapper input { margin-top: 3px; cursor: pointer; }
.entry-card .checkbox-wrapper label { cursor: pointer; font-size: 13px; color: var(--text-secondary); line-height: 1.6; cursor: pointer; }

/* ============ 答题页 ============ */
.survey-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
}
.survey-header {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary);
}
.survey-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
}
.survey-header .desc {
    color: var(--text-secondary);
    line-height: 1.7;
}
.survey-header .info-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}

.question-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.question-card:hover { box-shadow: var(--shadow); }
.question-number {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}
.question-card h3 {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.5;
}
.question-card h3 .required-mark { color: var(--danger); margin-right: 4px; }
.question-card .type-hint {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 4px;
    font-size: 12px;
    margin-left: 8px;
}

/* 选项样式 */
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.option-item:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}
.option-item input { cursor: pointer; }
.option-item.checked {
    border-color: var(--primary);
    background: var(--primary-light);
}
.option-item label { cursor: pointer; flex: 1; font-size: 14px; }
.other-text-input {
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* 评分 */
.rating-group { display: flex; gap: 12px; }
.rating-item {
    flex: 1;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.rating-item:hover { border-color: var(--primary); background: var(--bg-hover); }
.rating-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.rating-item input { display: none; }

/* ============ 后台管理 ============ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: #001529;
    color: #fff;
    padding: 20px 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
}
.admin-sidebar-brand {
    padding: 0 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-sidebar-brand .logo-icon {
    width: 32px; height: 32px; font-size: 16px;
}
.admin-sidebar-nav { padding: 16px 0; }
.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
}
.admin-sidebar-nav a:hover {
    color: #fff;
    background: rgba(82, 196, 26, 0.2);
}
.admin-sidebar-nav a.active {
    color: #fff;
    background: var(--primary);
}
.admin-main {
    flex: 1;
    margin-left: 220px;
    min-width: 0;
}
.admin-header {
    background: #fff;
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 40;
}
.admin-header h2 { font-size: 18px; font-weight: 600; }
.admin-header-right { display: flex; gap: 20px; align-items: center; color: var(--text-secondary); }
.admin-content { padding: 24px 32px; }

/* 数据卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card .label {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 8px;
}
.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
}
.stat-card .sub {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-light);
}

/* 图表区域 */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.chart-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.chart-card .chart-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chart-container { height: 340px; padding: 16px; }

/* 表格 */
.data-table-wrapper {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.data-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--text-main);
}
.data-table tr:hover td { background: var(--bg-hover); }
.data-table .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 登录页 */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    padding: 40px 24px;
}
.login-card {
    background: #fff;
    padding: 48px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 420px;
}
.login-card h2 { font-size: 28px; margin-bottom: 8px; text-align: center; }
.login-card .subtitle { text-align: center; color: var(--text-light); margin-bottom: 32px; }

/* 提示 */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #389e0d; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.alert-info { background: var(--primary-light); border: 1px solid #b7eb8f; color: #389e0d; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    background: #fff;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 页面底部 */
.footer {
    background: #fff;
    padding: 32px 24px;
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    border-top: 1px solid var(--border-light);
    margin-top: 40px;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .navbar-menu { display: none; }
    .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 16px; }
    .entry-card, .login-card { padding: 32px 24px; }
}

/* 工具类 */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 8px !important; }
.mb-2 { margin-bottom: 16px !important; }
.mb-3 { margin-bottom: 24px !important; }
.mt-2 { margin-top: 16px !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-muted { color: var(--text-light) !important; }
.d-none { display: none !important; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 16px; }
.fw-bold { font-weight: 600; }
