* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 14px 16px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
    position: sticky;
    top: 0;
    z-index: 101;
}

.date-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.date-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
}

.day-name {
    font-size: 14px;
    opacity: 0.9;
}

.period-nav {
    display: flex;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 56px;
    z-index: 100;
}

.period-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #95a5a6;
    transition: all 0.2s ease;
    position: relative;
    gap: 4px;
}

.period-tab .tab-icon {
    font-size: 22px;
}

.period-tab.active {
    color: #667eea;
    font-weight: 600;
}

.period-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.content-area {
    flex: 1;
    padding: 16px 12px;
}

.period-section {
    display: none;
}

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

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

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

.script-list {
    max-width: 600px;
    margin: 0 auto;
}

.script-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease;
}

.script-card:active {
    transform: scale(0.98);
}

.script-time {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
}

.script-content {
    font-size: 15px;
    line-height: 1.7;
    color: #2c3e50;
    word-break: break-all;
    white-space: pre-wrap;
}

.script-image {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

.script-image img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    -webkit-user-select: auto;
    user-select: auto;
    -webkit-touch-callout: default;
}

.image-only-card .script-image img {
    max-height: 400px;
    object-fit: contain;
}

.image-hint {
    text-align: center;
    color: #7f8c8d;
    font-size: 13px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 8px;
}

.copy-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    opacity: 0.9;
}

.copy-btn.copied {
    background: linear-gradient(135deg, #00b894, #00cec9);
}

.copy-icon {
    font-size: 16px;
}

.bg-red {
    background: #c0392b;
    background: -webkit-linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.bg-red .script-content {
    color: #fff;
}

.bg-red .script-time {
    background: rgba(255, 255, 255, 0.25);
}

.bg-red .copy-btn {
    background: #e74c3c;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* 绿色 */
.bg-green {
    background: #00896d;
    background: -webkit-linear-gradient(135deg, #00a384 0%, #00896d 100%);
    background: linear-gradient(135deg, #00a384 0%, #00896d 100%);
}

/* 蓝色 */
.bg-blue {
    background: #2980b9;
    background: -webkit-linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* 橙色 */
.bg-orange {
    background: #d35400;
    background: -webkit-linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

/* 紫色 */
.bg-purple {
    background: #6c5ce7;
    background: -webkit-linear-gradient(135deg, #8e7bf0 0%, #6c5ce7 100%);
    background: linear-gradient(135deg, #8e7bf0 0%, #6c5ce7 100%);
}

/* 青色 */
.bg-teal {
    background: #00838f;
    background: -webkit-linear-gradient(135deg, #00acc1 0%, #00838f 100%);
    background: linear-gradient(135deg, #00acc1 0%, #00838f 100%);
}

/* 新颜色统一样式（白字） */
.bg-green .script-content,
.bg-blue .script-content,
.bg-orange .script-content,
.bg-purple .script-content,
.bg-teal .script-content {
    color: #fff;
}

.bg-green .script-time,
.bg-blue .script-time,
.bg-orange .script-time,
.bg-purple .script-time,
.bg-teal .script-time {
    background: rgba(255, 255, 255, 0.25);
}

.no-copy {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.no-copy .script-content {
    -webkit-user-select: none;
    user-select: none;
}

.no-copy-hint {
    margin-top: 12px;
    text-align: center;
    color: #b2bec3;
    font-size: 13px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.bg-red .no-copy-hint {
    background: #e74c3c;
    color: #fff;
}

.bg-green .no-copy-hint,
.bg-blue .no-copy-hint,
.bg-orange .no-copy-hint,
.bg-purple .no-copy-hint,
.bg-teal .no-copy-hint {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
}

@media (min-width: 600px) {
    .content-area {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 380px) {
    .period-tab {
        padding: 12px 4px;
        font-size: 12px;
    }

    .period-tab .tab-icon {
        font-size: 20px;
    }

    .content-area {
        padding: 12px 8px;
    }

    .script-content {
        font-size: 17px;
    }
}
