:root {
    --ugu-primary: #b83b5e;
    /* 胭脂红 */
    --ugu-dark: #3f3f3f;
    --ugu-light: #f9f7f2;
    /* 宣纸白 */
    --ugu-bg: #f8f9fa;
}

body {
    background-color: var(--ugu-light);
    font-family: "Microsoft YaHei", "SimSun", serif;
    /* 衬线体更有书卷气 */
}

/* --- 首页 Hero 区域 --- */
.hero {
    background: linear-gradient(135deg, #2c3e50 0%, #000000 100%);
    color: #fff;
    padding: 80px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.brand-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 5px;
    margin-bottom: 20px;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    border-radius: 50px;
    padding: 15px 30px;
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    font-size: 1.1rem;
    width: 100%;
}

/* --- 搜索结果下拉框 --- */
#search-results {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    text-align: left;
    color: #333;
}

.search-item {
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: #333;
}

.search-item:hover {
    background-color: #f8f9fa;
    color: var(--ugu-primary);
}

/* --- A-Z 索引条 --- */
.index-bar {
    background: #fff;
    padding: 15px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-top: -30px;
    border-radius: 8px;
    position: relative;
    z-index: 10;
}

.letter-link {
    color: var(--ugu-dark);
    font-weight: bold;
    text-decoration: none;
    padding: 5px 8px;
    display: inline-block;
    /* 修复点击区域 */
    cursor: pointer;
    transition: all 0.2s;
}

.letter-link:hover,
.letter-link.active {
    color: var(--ugu-primary);
    background: #ffe3e3;
    border-radius: 4px;
}

/* --- 每日一典卡片 --- */
.daily-card {
    background: linear-gradient(to right, #b83b5e, #6a2c70);
    color: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

.daily-label {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* --- 首页成语小卡片 --- */
.idiom-card-home {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    transition: transform 0.2s;
    text-align: center;
    position: relative;
    /* 限制 stretched-link */
}

.idiom-card-home:hover {
    transform: translateY(-5px);
    border-color: var(--ugu-primary);
    box-shadow: 0 5px 15px rgba(184, 59, 94, 0.1);
}

.idiom-link {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    display: block;
}

.idiom-desc {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.idiom-item.hidden {
    display: none !important;
}

/* --- 详情页样式 --- */
.ugu-navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.brand-logo {
    font-weight: bold;
    color: var(--ugu-primary);
    letter-spacing: 2px;
}

.idiom-card-detail {
    background: #fff;
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 40px;
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

/* 详情页纹样装饰 */
.idiom-card-detail::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, #fceed1 50%);
    opacity: 0.5;
}

.idiom-title {
    font-size: 3rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 900;
}

.idiom-pinyin {
    font-size: 1.2rem;
    color: #6c757d;
    font-family: "Courier New", monospace;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.1rem;
    color: var(--ugu-primary);
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 10px;
    border-left: 4px solid var(--ugu-primary);
    padding-left: 10px;
}

.content-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #495057;
    text-align: justify;
}

/* --- 通用页脚 --- */
.footer {
    background: #2c3e50;
    color: #acc1d4;
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
}