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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* 首页 */
.home-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.home-content {
    text-align: center;
    color: white;
}

.home-logo {
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.2);
    border-radius: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 30px;
    font-size: 40px;
    backdrop-filter: blur(10px);
}

.home-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.home-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.home-btn {
    display: inline-block;
    padding: 16px 50px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* 顶部导航 - 修复宽度 */
.top-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 0 0 12px 12px;
}

.nav-left, .nav-right {
    min-width: 80px;
}

.nav-title {
    font-weight: 600;
    font-size: 17px;
    text-align: center;
    flex: 1;
}

.nav-home {
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.nav-logout, .nav-admin, .nav-sort {
    color: white;
    text-decoration: none;
    font-size: 18px;
    margin-left: 12px;
    display: inline-block;
}

.user-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    display: inline-block;
}

@media (max-width: 600px) {
    .user-name {
        font-size: 11px;
        max-width: 120px;
    }
}

/* 快捷入口 */
.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.quick-link-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.quick-link-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.quick-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 22px;
}

.quick-link-item span {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

/* 工具区域 */
.tools-section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
    padding-left: 10px;
    border-left: 4px solid #667eea;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 900px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

.tool-category-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.tool-category-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.tool-cat-icon {
    font-size: 18px;
}

.tool-cat-name {
    font-weight: 700;
    font-size: 15px;
    color: #333;
}

.tool-category-body {
    padding: 12px;
}

.tool-link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tool-link-item:last-child {
    margin-bottom: 0;
}

.tool-link-item:hover {
    background: #e9ecef;
}

.tool-link-title {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.tool-link-btn {
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
}

.no-tools {
    text-align: center;
    color: #999;
    padding: 15px;
    font-size: 13px;
}

/* 提示词页面 */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.tab-item {
    padding: 8px 16px;
    background: #f0f2f5;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.tab-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.tab-item:hover:not(.active) {
    background: #e9ecef;
}

/* 添加按钮 */
.btn-add-prompt {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-prompt:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 提示词列表 */
.prompt-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.prompt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.prompt-item:last-child {
    border-bottom: none;
}

.prompt-item:hover {
    background: #f8f9fa;
}

.prompt-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.prompt-item-badge {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    white-space: nowrap;
}

.prompt-item-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prompt-item-owner {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.prompt-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-copy {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #218838;
}

.btn-edit-prompt {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.btn-delete-prompt {
    padding: 8px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

.login-tip {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 13px;
}

/* 后台管理 */
.admin-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
}

.admin-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 20px;
}

.admin-tabs {
    display: none;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
    color: #666;
}

.data-table td {
    font-size: 14px;
}

.data-table tr:hover {
    background: #fafafa;
}

.btn-edit, .btn-delete {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-add {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 15px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-submit {
    flex: 1;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.btn-cancel {
    padding: 12px 20px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

/* 公告 */
.announcement {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 1px solid #ffeeba;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #856404;
    font-size: 14px;
}

.announcement-icon {
    font-size: 18px;
}

/* 教程列表 */
.tutorial-list {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 教程行（扁平气泡框） */
.tutorial-row {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.tutorial-row:last-child {
    margin-bottom: 0;
}

.tutorial-row:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.tutorial-row-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.tutorial-row-content {
    flex: 1;
    min-width: 0;
}

.tutorial-row-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.tutorial-row-arrow {
    font-size: 18px;
    color: #ccc;
    margin-left: 10px;
}

.tutorial-card {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.tutorial-card:last-child {
    margin-bottom: 0;
}

.tutorial-card:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.tutorial-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    margin-right: 15px;
    flex-shrink: 0;
}

.tutorial-card-content {
    flex: 1;
    min-width: 0;
}

.tutorial-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.tutorial-card-meta {
    font-size: 12px;
    color: #999;
}

.tutorial-badge-link {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 5px;
}

.tutorial-badge-doc {
    background: #fce4ec;
    color: #c2185b;
    padding: 2px 8px;
    border-radius: 4px;
}

.tutorial-card-arrow {
    font-size: 20px;
    color: #ccc;
    margin-left: 10px;
}

/* 响应式 */
@media (max-width: 600px) {
    .home-title {
        font-size: 36px;
    }
    
    .quick-links {
        grid-template-columns: 1fr;
    }
    
    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab-item {
        white-space: nowrap;
    }
    
    .prompt-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .prompt-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .btn-copy {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .btn-edit-prompt, .btn-delete-prompt {
        padding: 6px 10px;
        font-size: 11px;
    }
}
