/* 前端展示样式 - 大气、现代 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffffff;
    color: #1f2937;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部 */
.front-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
}

.front-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.logo svg {
    color: #3b82f6;
}

nav a {
    margin-left: 25px;
    color: #4b5563;
    text-decoration: none;
    font-size: 15px;
}

nav a:hover {
    color: #3b82f6;
}

/* 主内容 */
.front-main {
    min-height: calc(100vh - 64px - 60px);
    padding: 40px 0;
}

/* 英雄区 */
.hero {
    background: #f9fafb;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    color: #6b7280;
    margin-bottom: 24px;
}

.search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-radius: 8px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-right: none;
    font-size: 15px;
}

.search-bar button {
    padding: 12px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
}

/* 分类区块 */
.category-section {
    margin-bottom: 40px;
}

.category-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.course-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.course-card .cover img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.course-card .info {
    padding: 16px;
}

.course-card h3 {
    font-size: 17px;
    margin-bottom: 6px;
}

.course-card p {
    font-size: 14px;
    color: #6b7280;
}

/* 文档详情 */
.document-container {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

.document-container h1 {
    font-size: 28px;
    margin-bottom: 24px;
}

.content img,
.content video {
    max-width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.password-prompt {
    max-width: 400px;
    margin: 60px auto;
    text-align: center;
}

.password-prompt input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.password-prompt button {
    padding: 10px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
}

/* 文档列表 */
.document-list {
    list-style: none;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.document-list li {
    padding: 12px 18px;
    border-bottom: 1px solid #f3f4f6;
}

.document-list li:last-child {
    border-bottom: none;
}

.document-list a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #1f2937;
}

.doc-title {
    flex: 1;
}

.badge-lock {
    background: #fde68a;
    color: #92400e;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

/* AI 聊天 */
.ai-chat-container {
    max-width: 700px;
    margin: 0 auto;
}

.chat-box {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    background: #f9fafb;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.msg.user {
    background: #3b82f6;
    color: #fff;
    align-self: flex-end;
}

.msg.assistant {
    background: #fff;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
}

.msg.error {
    background: #fee2e2;
    color: #b91c1c;
    align-self: center;
}

.ai-form {
    display: flex;
    gap: 10px;
}

.ai-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.ai-form button {
    padding: 10px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* 用户认证 */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-box {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    width: 380px;
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 24px;
}

.auth-box .form-group {
    margin-bottom: 16px;
}

.auth-box label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.auth-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.auth-box .btn {
    width: 100%;
    margin-top: 10px;
}

.text-center {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.text-muted {
    color: #9ca3af;
    font-size: 13px;
}

.empty-state {
    padding: 60px;
    text-align: center;
    color: #9ca3af;
    font-size: 16px;
}

/* 页脚 */
.front-footer {
    background: #f9fafb;
    text-align: center;
    padding: 20px 0;
    color: #6b7280;
    font-size: 14px;
    border-top: 1px solid #e5e7eb;
}