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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* 角色选择界面 */
.role-selection {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #fbfbfd;
    padding: 40px 20px;
}

.role-container {
    background: white;
    padding: 60px 50px;
    border-radius: 18px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@media (min-width: 1025px) {
    .role-container {
        max-width: 100%;
        padding: 60px 80px;
    }
    
    .role-selection {
        padding: 40px 60px;
    }
}

@media (max-width: 1024px) {
    .role-container {
        max-width: 680px;
    }
}

.logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
}

.school-logo,
.frame-logo {
    height: 50px;
    width: auto;
    max-width: 120px;
    max-height: 50px;
    -webkit-object-fit: contain;
    object-fit: contain;
    display: block;
    border: none;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    opacity: 0.9;
}

.school-title {
    margin-bottom: 8px;
    color: #1d1d1f;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-align: center;
}

.club-title {
    margin-bottom: 30px;
    color: #86868b;
    font-size: 19px;
    font-weight: 400;
    letter-spacing: -0.2px;
    text-align: center;
}

.intro-section {
    margin-bottom: 30px;
    padding: 30px;
    background: #f5f5f7;
    border-radius: 12px;
    text-align: left;
}

.intro-text {
    color: #1d1d1f;
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 24px;
    letter-spacing: -0.2px;
}

.intro-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #424245;
    font-size: 15px;
    line-height: 1.5;
}

.feature-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.feature-text {
    letter-spacing: -0.1px;
}

.role-container h1 {
    margin-bottom: 40px;
    color: #1d1d1f;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: -0.8px;
}

.home-layout {
    display: grid;
    gap: 40px;
    margin-top: 40px;
    width: 100%;
}

@media (min-width: 1025px) and (orientation: landscape) {
    .home-layout {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px), (orientation: portrait) {
    .home-layout {
        grid-template-columns: 1fr;
    }
}

.home-left {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.home-right {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 20px;
    margin-top: 0;
    letter-spacing: -0.5px;
    text-align: center;
}

.role-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.tabs-container {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid #e5e5e7;
    background: #fbfbfd;
}

.tab-btn {
    flex: 1;
    padding: 16px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 17px;
    font-weight: 500;
    color: #86868b;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: -0.2px;
}

.tab-btn:hover {
    color: #1d1d1f;
    background: rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
    color: #1d1d1f;
    border-bottom-color: #007aff;
    background: white;
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.characters-section,
.plot-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.characters-content {
    max-height: 700px;
    overflow-y: auto;
}

.tab-content .characters-content {
    max-height: 700px;
}

.tab-content .plot-content {
    max-height: 700px;
    overflow-y: auto;
}

.character-group {
    margin-bottom: 30px;
}

.character-group:last-child {
    margin-bottom: 0;
}

.group-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.character-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.character-item {
    padding: 16px;
    background: #f5f5f7;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #424245;
}

.character-item strong {
    display: block;
    color: #1d1d1f;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.character-item p {
    margin: 6px 0;
    letter-spacing: -0.1px;
}

.plot-content {
    max-height: 700px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.8;
    color: #424245;
}

.plot-intro {
    margin-bottom: 24px;
    color: #86868b;
    font-style: italic;
}

.plot-part {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid #e5e5e7;
}

.plot-part:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.plot-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.plot-content p {
    margin-bottom: 12px;
    letter-spacing: -0.1px;
}

.plot-content strong {
    color: #1d1d1f;
    font-weight: 600;
}

.role-btn {
    padding: 16px 24px;
    border: 1px solid #d2d2d7;
    background: white;
    color: #1d1d1f;
    border-radius: 12px;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
}

.role-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f7;
    opacity: 0;
    transition: opacity 0.2s;
}

.role-btn:hover {
    background: #f5f5f7;
    border-color: #d2d2d7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.role-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.director-btn {
    border-color: #1d1d1f;
    background: #1d1d1f;
    color: white;
    grid-column: 1 / -1;
    font-weight: 500;
    margin-top: 8px;
}

.director-btn::before {
    background: rgba(255, 255, 255, 0.1);
}

.director-btn:hover {
    background: #424245;
    border-color: #424245;
    color: white;
}

/* 主界面 */
.main-content {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.header {
    background: white;
    padding: 20px 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header-left h2 {
    margin-bottom: 5px;
    color: #333;
}

.current-role {
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

.header-right {
    display: flex;
    gap: 10px;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e5e7eb;
    color: #333;
}

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

/* 索引导航 */
.index-nav {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.index-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.act-index {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.act-link {
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    color: #667eea;
    text-decoration: none;
}

.act-link:hover {
    background: #667eea;
    color: white;
}

/* 表格 */
.table-container {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.scenes-table thead {
    background: #667eea;
    color: white;
}

.scenes-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.scenes-table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.scenes-table tbody tr:hover {
    background: #f9fafb;
}

.scenes-table tbody tr.highlighted {
    background: #fef3c7 !important;
    border-left: 4px solid #f59e0b;
}

.scenes-table tbody tr.completed {
    color: #9ca3af;
}

.scenes-table tbody tr.completed td {
    color: #9ca3af;
}

.col-checkbox {
    width: 80px;
    text-align: center;
}

.col-act {
    width: 120px;
}

.col-scene {
    width: 200px;
}

.col-characters {
    width: 180px;
}

.col-description {
    min-width: 400px;
}

.col-notes {
    width: 200px;
}

.scene-info {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 5px;
}

.scene-location {
    font-weight: 600;
    color: #333;
}

.scene-atmosphere {
    font-style: italic;
    color: #667eea;
}

.characters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.character-tag {
    padding: 4px 8px;
    background: #e0e7ff;
    color: #4338ca;
    border-radius: 4px;
    font-size: 12px;
}

.description-text {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 14px;
}

.notes-text {
    font-size: 13px;
    color: #6b7280;
    white-space: pre-wrap;
}

.editable {
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.editable:hover {
    background: #f3f4f6;
}

/* 复选框 */
.checkbox-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* 验证码弹窗全屏样式 */
#verification-modal {
    background: #000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#verification-modal .modal-content {
    max-width: 600px;
    background: #fbfbfd;
    box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}

.modal-content.small {
    max-width: 400px;
}

.modal-content.large {
    max-width: 800px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-content h2, .modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input[type="password"],
.modal-content input[type="text"],
.modal-content textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 15px;
    resize: vertical;
}

.modal-content input[type="password"]:focus,
.modal-content input[type="text"]:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login-large {
    width: 100%;
    padding: 18px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-login-large:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login-large:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.verification-message {
    margin-bottom: 20px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 10px;
}

.stats-content {
    font-size: 16px;
}

.stat-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 10px;
}

.stat-label {
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    color: #667eea;
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e5e7eb;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .scenes-table {
        font-size: 13px;
    }
    
    .scenes-table th,
    .scenes-table td {
        padding: 10px;
    }
    
    .col-description {
        min-width: 300px;
    }
}

@media (max-width: 1024px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .characters-content,
    .plot-content {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .scenes-table {
        min-width: 1000px;
    }
    
    .role-container {
        padding: 40px 30px;
    }
    
    .intro-features {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .intro-section {
        padding: 24px 20px;
    }
    
    .school-title {
        font-size: 24px;
    }
    
    .club-title {
        font-size: 17px;
    }
    
    .role-container h1 {
        font-size: 28px;
    }
    
    .home-layout {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-top: 30px;
    }
    
    .characters-section,
    .plot-section {
        padding: 20px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .characters-content,
    .plot-content {
        max-height: none;
    }
}

/* 宽屏横屏布局 */
@media (min-width: 1025px) and (orientation: landscape) {
    .role-selection {
        padding: 40px 60px;
    }
    
    .role-container {
        max-width: 100%;
        padding: 60px 80px;
    }
    
    .home-layout {
        grid-template-columns: 1fr 1fr;
    }
    
    .characters-content {
        max-height: 800px;
    }
    
    .plot-content {
        max-height: 800px;
    }
}

