/* 基础样式与变量定义 */
:root {
  /* 主色调 */
  --primary-color: #4338CA; /* 深蓝紫色 - 传达科技感与可信度 */
  --primary-light: rgba(67, 56, 202, 0.1);
  --primary-dark: #332D85;
  /* 辅助色 */
  --secondary-color: #EC4899; /* 粉色 - 用于强调和交互元素 */
  --accent-color: #06B6D4; /* 青色 - 用于特殊提示 */
  /* 中性色 */
  --text-primary: #1E293B; /* 主要文本 */
  --text-secondary: #64748B; /* 次要文本 */
  --text-tertiary: #94A3B8; /*  tertiary文本 */
  --background: #F8FAFC; /* 页面背景 */
  --card-bg: #FFFFFF; /* 卡片背景 */
  --border-color: #E2E8F0; /* 边框颜色 */
  /* 功能色 */
  --success-color: #10B981; /* 成功 */
  --warning-color: #F59E0B; /* 警告 */
  --error-color: #EF4444; /* 错误 */
  --error-dark: #B91C1C; /* 深错误色 */
  /* 尺寸变量 */
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --border-radius-xl: 32px;
  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
    line-height: 1.7;
    min-height: 100vh;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 200px;
    height: 200px;
    background: rgba(90, 103, 216, 0.1);
    border-radius: 50%;
    animation: float 6s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(30px, 30px);
    }
}

.container:hover {
    transform: translateY(-8px);
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    margin-bottom: 2rem;
    box-shadow: 0 10px 25px rgba(67, 56, 202, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* 设备信息提示 */
.device-info {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--primary-light);
    border-radius: var(--border-radius-sm);
    color: var(--primary-color);
    font-size: 0.9rem;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.device-info p {
    margin: 0.5rem 0;
}

/* 错误消息样式 */
.error-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error-color);
    border-radius: var(--border-radius-sm);
    color: var(--error-color);
    font-size: 0.9rem;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    margin: 15px 0 0;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.navbar h1 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    animation: scaleIn 1s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
    }
    to {
        transform: scale(1);
    }
}

/* 新闻列表 */
.news-list {
    list-style-type: none;
    padding: 0;
    margin-top: 0px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-item {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
    border: 1px solid #e6eaf0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.news-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #5A67D8 0%, #4C51BF 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.news-item:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

.news-item:hover::after {
    transform: scaleX(1);
}

.news-item a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.3rem;
    display: block;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.news-item a:hover {
    color: #2b6cb0;
    transform: translateX(8px);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(67, 56, 202, 0.2);
    gap: 0.5rem;
}

.btn:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 56, 202, 0.3);
}

/* 返回主页按钮样式 */
.btn-home {
    background-color: white;
    color: var(--primary-color);
    font-size: 1.1rem;
    padding: 0.875rem 1.75rem;
    box-shadow: 0 4px 8px rgba(67, 56, 202, 0.3);
    border: 1px solid var(--primary-color);
}

.btn-home:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(67, 56, 202, 0.4);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn:hover {
    background-color: #bbdefb;
    color: #003366;
    border-color: #a0c6e6;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* 新闻内容样式 */
.news-content {
    margin-top: 2rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    line-height: 1.85;
    letter-spacing: 0.015em;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.news-content h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.news-content p {
    margin-bottom: 1.25rem;
    transition: color 0.2s ease;
}

.news-content p:hover {
    color: var(--primary-color);
}

/* 语音控制区域样式 */
.speech-controls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    align-items: center;
    padding: 1rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.speech-options-container {
    margin: 0 0 1rem 0;
    padding: 0 1rem;
}

.speech-buttons-group {
    display: flex;
    gap: 0.75rem;
}

.speech-options-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-left: auto;
}

.rate-control, .voice-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.form-control, .form-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--card-bg);
    transition: border-color 0.2s ease;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.1);
}

/* 新闻选择复选框样式 */
.news-item-checkbox {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.news-checkbox {
    transform: scale(1.3);
    margin-right: 15px;
    vertical-align: middle;
}

.news-checkbox:checked {
    background-color: var(--primary-color);
}

/* 全选/取消全选样式 */
.select-all-container {
    display: flex;
    align-items: center;
    margin: 15px 0;
    padding: 10px;
    background-color: var(--card-bg);
    border-radius: 5px;
}

.select-all-container input[type="checkbox"] {
    transform: scale(1.3);
    margin-right: 10px;
}

.select-all-container label {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

/* 单条新闻播报按钮样式 */
.play-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--primary-border);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
    margin-left: 15px;
    cursor: pointer;
    font-size: 0.95rem;
    gap: 6px;
}

.play-button:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
}

.more-news-container {
    text-align: right;
    margin: 1rem 0;
}

/* 新增: 新闻标签样式 */
.news-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.news-tag:hover {
    background-color: var(--primary-color);
    color: white;
}

.news-content h2 {
    color: #245ca0;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.6rem;
    border-bottom: 2px solid #e6eaf0;
    padding-bottom: 10px;
}

.news-content p {
    margin-bottom: 20px;
    color: #333; /* 调整段落字体颜色 */
}

.news-content a {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
}

.news-content a:hover {
    text-decoration: underline;
    color: #2b6cb0;
}

.news-content pre {
    background: #f0f6fc;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.95em;
    color: #333;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 30px 20px;
        border-radius: 20px;
        padding: 30px;
    }

    .news-list {
        grid-template-columns: 1fr;
    }

    .news-item {
        padding: 20px;
    }
}
/* 语音播报按钮样式 */
.speech-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #e3f2fd;
    color: #004d99;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #d0e1f0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.speech-btn:hover {
    background-color: #bbdefb;
    color: #003366;
    border-color: #a0c6e6;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}
/* 语音控制按钮样式 */
.speech-control-btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #e3f2fd;
    color: #004d99;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 500;
    border: 1px solid #d0e1f0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    margin-right: 10px;
}

.speech-control-btn:hover {
    background-color: #bbdefb;
    color: #003366;
    border-color: #a0c6e6;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}

/* 语速调节输入框样式 */
.speech-rate-input {
    padding: 12px;
    border: 1px solid #d0e1f0;
    border-radius: 12px;
    margin-bottom: 20px;
    margin-right: 10px;
}
/* 语音类型选择下拉框样式 */
.speech-voice-select {
    padding: 12px;
    border: 1px solid #d0e1f0;
    border-radius: 12px;
    margin-bottom: 20px;
    margin-right: 10px;
}