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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #fafafa;
    color: #18181b;
}

.app-container {
    display: flex;
    height: 100vh;
    background: #fafafa;
}

/* Sidebar */
.sidebar {
    width: 80px;
    background: white;
    border-right: 1px solid #e4e4e7;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .sidebar {
        width: 256px;
    }
}

.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f4f4f5;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .sidebar-header {
        justify-content: flex-start;
        padding: 0 24px;
    }
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: #4f46e5;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    margin-left: 12px;
    letter-spacing: -0.025em;
}

.mode-switcher {
    padding: 16px 12px;
    border-bottom: 1px solid #f4f4f5;
    flex-shrink: 0;
}

.mode-switcher {
    display: flex;
    background: #f4f4f5;
    padding: 4px;
    border-radius: 8px;
}

.mode-btn {
    flex: 1;
    padding: 6px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #71717a;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    color: #3f3f46;
}

.mode-btn.active {
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #18181b;
}

.nav-menu {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #52525b;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

@media (min-width: 768px) {
    .nav-item {
        justify-content: flex-start;
    }
}

.nav-item:hover {
    background: #f4f4f5;
}

.nav-item.active {
    background: #eef2ff;
    color: #4338ca;
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item span {
    margin-left: 12px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid #f4f4f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.footer-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.footer-btn i {
    width: 16px;
    height: 16px;
}

.amber-btn {
    color: #b45309;
    background: #fef3c7;
    border-color: #fcd34d;
}

.amber-btn:hover {
    background: #fde68a;
}

.indigo-btn {
    color: #4f46e5;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.indigo-btn:hover {
    background: #e0e7ff;
}

.download-btn {
    color: #52525b;
    background: white;
    border-color: #e4e4e7;
}

.download-btn:hover {
    background: #fafafa;
}

.blue-btn {
    color: #2563eb;
    background: #dbeafe;
    border-color: #93c5fd;
}

.blue-btn:hover {
    background: #bfdbfe;
}

.green-btn {
    color: #16a34a;
    background: #dcfce7;
    border-color: #86efac;
}

.green-btn:hover {
    background: #bbf7d0;
}

.reset-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 4px;
}

.reset-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    color: #ca8a04;
    background: #fef9c3;
}

.btn-icon-small {
    width: 12px;
    height: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.main-header {
    height: 64px;
    background: white;
    border-bottom: 1px solid #e4e4e7;
    display: flex;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
}

.main-header h2 {
    font-size: 16px;
    font-weight: 500;
    color: #27272a;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

@media (min-width: 768px) {
    .content-area {
        padding: 32px;
    }
}

/* Content Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f4f4f5;
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 20px;
    font-weight: 600;
    color: #18181b;
    margin-bottom: 24px;
}

.card h3 {
    font-size: 14px;
    font-weight: 500;
    color: #3f3f46;
    margin-bottom: 8px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    background: #fafafa;
    color: #3f3f46;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: none;
    font-family: inherit;
}

.btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-secondary {
    background: #f4f4f5;
    color: #3f3f46;
}

.btn-secondary:hover {
    background: #e4e4e7;
}

/* Theme Tags */
.theme-selector {
    margin-bottom: 16px;
}

.gender-switcher {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.gender-btn {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
}

.gender-btn.male {
    background: #f4f4f5;
    color: #52525b;
    border-color: #e4e4e7;
}

.gender-btn.male:hover {
    background: #e4e4e7;
}

.gender-btn.male.active {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.gender-btn.female {
    background: #f4f4f5;
    color: #52525b;
    border-color: #e4e4e7;
}

.gender-btn.female:hover {
    background: #e4e4e7;
}

.gender-btn.female.active {
    background: #fce7f3;
    color: #be185d;
    border-color: #f9a8d4;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s;
}

.tag {
    background: #f4f4f5;
    color: #52525b;
    border-color: #e4e4e7;
}

.tag:hover {
    background: #e4e4e7;
}

.tag.selected {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.tag.selected.pink {
    background: #fce7f3;
    color: #be185d;
    border-color: #f9a8d4;
}

/* Character Cards */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.character-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f4f4f5;
    padding: 20px;
}

.character-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.character-name {
    font-size: 18px;
    font-weight: 600;
    color: #18181b;
    background: transparent;
    border: none;
    padding: 0;
}

.character-role {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 9999px;
    background: #eef2ff;
    color: #4338ca;
    border: none;
}

.character-description {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    color: #52525b;
    background: #fafafa;
    border: 1px solid #f4f4f5;
    border-radius: 8px;
    resize: none;
    min-height: 96px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: white;
    border-radius: 16px;
    border: 2px dashed #e4e4e7;
}

.empty-state i {
    width: 48px;
    height: 48px;
    color: #d4d4d8;
    margin: 0 auto 12px;
}

.empty-state p {
    color: #71717a;
    font-size: 14px;
}

/* Chapter List */
.chapter-item {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f4f4f5;
    padding: 20px;
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.chapter-number {
    width: 48px;
    height: 48px;
    background: #fafafa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-family: serif;
    color: #a1a1aa;
    flex-shrink: 0;
}

.chapter-content {
    flex: 1;
}

.chapter-title {
    font-size: 16px;
    font-weight: 600;
    color: #18181b;
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 8px;
    width: 100%;
}

.chapter-summary {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    color: #52525b;
    background: #fafafa;
    border: 1px solid #f4f4f5;
    border-radius: 8px;
    resize: none;
    min-height: 80px;
}

.chapter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn-indigo {
    background: #eef2ff;
    color: #4338ca;
}

.action-btn-indigo:hover {
    background: #e0e7ff;
}

.action-btn-amber {
    background: #fef3c7;
    color: #b45309;
}

.action-btn-amber:hover {
    background: #fde68a;
}

.action-btn-red {
    background: #fee2e2;
    color: #dc2626;
}

.action-btn-red:hover {
    background: #fecaca;
}

/* Sponsor Section */
.sponsor-section {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0, #fce4ec, #f3e5f5, #fce4ec);
    background-size: 400% 400%;
    animation: pinkFlow 8s ease infinite;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(252, 228, 236, 0.5);
    overflow: hidden;
    position: relative;
}

@keyframes pinkFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.sponsor-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.sponsor-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #27272a;
    margin-bottom: 4px;
}

.sponsor-header p {
    font-size: 14px;
    color: #71717a;
}

.sponsor-codes {
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.sponsor-code {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.sponsor-code img {
    width: 128px;
    height: 128px;
    border-radius: 8px;
}

.sponsor-code span {
    font-size: 12px;
    font-weight: 500;
    color: #52525b;
    padding: 4px 8px;
    border-radius: 9999px;
}

.sponsor-code .wechat {
    background: #dcfce7;
    color: #15803d;
}

.sponsor-code .alipay {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Responsive */
@media (max-width: 767px) {
    .logo-text,
    .nav-item span,
    .footer-btn span,
    .reset-btn span {
        display: none;
    }
    
    .footer-btn {
        justify-content: center;
    }
    
    .reset-buttons {
        justify-content: center;
    }
}

/* 确保外部链接可以点击 */
a[href^="http"] {
    pointer-events: auto;
    cursor: pointer;
}
