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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    transition: background 1s ease;
}

/* 老黄历样式 - 美化版本 */
.calendar-section {
    background: linear-gradient(135deg, #fff9f0 0%, #fef5e7 50%, #fff2e6 100%);
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.15), 0 0 0 1px rgba(255, 152, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.calendar-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9800, #ff6b35, #ff9800);
    animation: headerShimmer 3s ease-in-out infinite;
}

.calendar-section::after {
    content: '🌟';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.3;
    animation: sparkle 2s ease-in-out infinite;
}

.calendar-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    position: relative;
    height: 100%;
    min-height: 300px;
}

.calendar-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.4);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 152, 0, 0.15);
    flex-grow: 1;
    margin-bottom: 0;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px dashed rgba(255, 152, 0, 0.3);
}

.calendar-icon {
    font-size: 22px;
    animation: calendarGlow 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 152, 0, 0.3));
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
    color: #e65100;
    text-shadow: 0 1px 2px rgba(255, 152, 0, 0.2);
}

.calendar-date {
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #ff6b35;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

/* 倒计时样式 */
.countdown-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.countdown-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.countdown-icon {
    font-size: 18px;
    animation: clockTick 2s ease-in-out infinite;
}

.countdown-title {
    font-size: 14px;
    font-weight: 600;
    color: #e65100;
}

.countdown-flip {
    perspective: 600px;
    margin-bottom: 8px;
}

.countdown-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    position: relative;
}

.countdown-display.flipping {
    animation: flipNumber 0.6s ease-in-out;
}

.countdown-number {
    font-size: 32px;
    font-weight: 700;
    color: #ff6b35;
    background: linear-gradient(45deg, #fff8e1, #ffe0b2);
    padding: 6px 12px;
    border-radius: 12px;
    border: 2px solid rgba(255, 152, 0, 0.3);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
    min-width: 50px;
    text-align: center;
    display: inline-block;
    transform-origin: center bottom;
}

.countdown-unit {
    font-size: 18px;
    font-weight: 500;
    color: #e65100;
    margin-top: 4px;
}

.countdown-label {
    text-align: center;
    font-size: 12px;
    color: #ff9800;
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 1px;
}

@keyframes clockTick {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(15deg);
    }
}

@keyframes flipNumber {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

/* 倒计时和时钟组合布局 */
.countdown-and-clock {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    align-items: stretch;
}

/* 时钟样式 */
.clock-container {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 15px;
    border: 1px solid rgba(255, 152, 0, 0.2);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.1);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
}

.clock-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.clock-icon {
    font-size: 18px;
    animation: clockTick 2s ease-in-out infinite;
}

.clock-title {
    font-size: 14px;
    font-weight: 600;
    color: #e65100;
}

.clock-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clock-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    background: linear-gradient(45deg, #fff8e1, #ffe0b2);
    padding: 10px 15px;
    border-radius: 12px;
    border: 2px solid rgba(255, 152, 0, 0.3);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.time-digit {
    font-size: 20px;
    color: #ff6b35;
    text-align: center;
    min-width: 24px;
    transition: all 0.3s ease;
}

.time-separator {
    font-size: 20px;
    color: #e65100;
    font-weight: 700;
    animation: separatorBlink 1s ease-in-out infinite;
}

.clock-date {
    font-size: 12px;
    color: #ff9800;
    font-weight: 500;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

/* 时钟数字变化动画 */
@keyframes digitFlip {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
        color: #fff;
    }
    100% {
        transform: rotateX(0deg);
    }
}

.time-digit.changing {
    animation: digitFlip 0.3s ease-in-out;
}

/* 分隔符闪烁动画 */
@keyframes separatorBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

.calendar-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.4);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 152, 0, 0.15);
}

.calendar-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
}

.label {
    font-weight: 600;
    color: #e65100;
    min-width: 30px;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(255, 152, 0, 0.1);
}

.suitable {
    color: #2e7d32;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(46, 125, 50, 0.1);
}

.unsuitable {
    color: #c62828;
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(198, 40, 40, 0.1);
}

.lucky-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.lucky-item {
    background: linear-gradient(45deg, #fff8e1, #ffe0b2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #e65100;
    border: 1px solid rgba(255, 152, 0, 0.3);
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.1);
}

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

@keyframes calendarGlow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* 随机背景渐变样式 */
.gradient-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.gradient-5 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.gradient-6 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.gradient-7 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.gradient-8 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
}

.gradient-9 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.gradient-10 {
    background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%);
}

.gradient-11 {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

.gradient-12 {
    background: linear-gradient(135deg, #f8b195 0%, #f67280 50%, #c06c84 100%);
}

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

/* 顶部区域布局 */
.top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
    align-items: stretch;
}

.left-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
}

.right-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.api-section {
    margin: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
    padding: 20px;
    padding-top: 0;
}

.api-section h2 {
    margin-bottom: auto;
    padding-bottom: 15px;
}

.api-section .form-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex-grow: 1;
    min-height: 0;
}

.api-section label {
    margin-bottom: auto;
    padding-bottom: 10px;
}

.api-section input {
    margin-bottom: 15px;
}

.api-section .btn {
    margin-top: auto;
}

/* 右侧内容容器样式 */
.right-content-wrapper {
    background: linear-gradient(135deg, #fff9f0 0%, #fef5e7 50%, #fff2e6 100%);
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.15), 0 0 0 1px rgba(255, 152, 0, 0.1);
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.right-content-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9800, #ff6b35, #ff9800);
    animation: headerShimmer 3s ease-in-out infinite;
}

.inspiration-section {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
}

.quote-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    position: relative;
    text-align: center;
    transition: transform 0.3s ease;
    min-height: 100px;
}

/* 老黄历区域填满右侧 */
.calendar-section {
    flex-grow: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.calendar-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100%;
    box-sizing: border-box;
}

.calendar-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
    line-height: 1.4;
}

/* 音效控制样式 */
.sound-control {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1000;
}

.sound-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.sound-volume {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 150px;
}

.sound-volume input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.sound-volume span {
    font-size: 12px;
    color: #333;
    font-weight: bold;
    text-align: center;
    display: block;
}

/* 选题卡片标签样式 */
.topic-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 24px;
}

.topic-tag {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.topic-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(238, 90, 36, 0.4);
}

.topic-tag.tag-blue {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.topic-tag.tag-green {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.topic-tag.tag-purple {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.topic-tag.tag-orange {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

/* 步骤指示器样式 */
.button-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.step-indicator {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
    animation: pulse 2s infinite;
    display: inline-block;
    user-select: none;
}

.step-1 {
    background: linear-gradient(135deg, #FF6B6B, #ee5a24);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

.step-2 {
    background: linear-gradient(135deg, #4ECDC4, #44a08d);
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
    margin-bottom: 15px;
    align-self: flex-start;
}

.step-3 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    margin-left: 8px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 20px rgba(76, 175, 80, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
    }
}

.step-1:hover,
.step-2:hover,
.step-3:hover {
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.section h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #4a5568;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #718096, #4a5568);
    color: white;
}

.btn-danger {
    background: linear-gradient(45deg, #f56565, #e53e3e);
    color: white;
}

.loading {
    color: #667eea;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 进度条样式 */
.progress-container {
    display: none;
    align-items: center;
    gap: 10px;
    margin: 0 10px;
    flex-grow: 1;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255,255,255,0.4),
        transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

/* 成功提示样式 */
.success-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: successPopIn 0.4s ease;
}

.success-toast::before {
    content: '✅';
    font-size: 20px;
}

@keyframes successPopIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.success-toast.fade-out {
    animation: successPopOut 0.3s ease forwards;
}

@keyframes successPopOut {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

.topics-container {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    margin-top: 20px;
    padding: 5px 0;
    scroll-behavior: smooth;
    /* 隐藏滚动条但保持滚动功能 */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f1f1;
}

/* Webkit浏览器滚动条样式 */
.topics-container::-webkit-scrollbar {
    height: 8px;
}

.topics-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.topics-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.topics-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.topic-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 280px;
    max-width: 320px;
    flex-shrink: 0;
}

.topic-card:hover {
    border-color: #667eea;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* 添加滚动提示箭头 */
.topics-container::before,
.topics-container::after {
    content: '';
    position: sticky;
    top: 0;
    width: 30px;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.topics-container::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.topics-container::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

.topics-container:hover::before {
    opacity: 1;
}

.topics-container:hover::after {
    opacity: 1;
}

.topic-card.selected {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #e8f9f5 100%);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.2);
}

.topic-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.topic-title {
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
    color: #2d3748;
    font-size: 15px;
    flex-grow: 1;
}

.topic-description {
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
}

.topic-tags {
    font-size: 11px;
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.tag {
    color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6efff 100%);
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
    transition: all 0.2s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
    border: 1px solid #e0e9ff;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag:hover {
    background: linear-gradient(135deg, #e6efff 0%, #d6e4ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.selected-topic {
    background: #f0fff4;
    border: 2px solid #48bb78;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.expansion-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.step {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    position: relative;
}

.step::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid #e9ecef;
    z-index: 1;
}

.step:last-child::before {
    display: none;
}

.step-header {
    margin-bottom: 20px;
}

.step-header h3 {
    color: #2d3748;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.optimized-prompt-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

.optimized-prompt-container h4 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 16px;
}

.prompt-content {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    color: #2d3748;
}

.prompt-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-info {
    background: linear-gradient(45deg, #4299e1, #3182ce);
    color: white;
}

.selected-topic h3 {
    color: #2d3748;
    margin-bottom: 10px;
}

.selected-topic p {
    font-size: 18px;
    line-height: 1.6;
    color: #2d3748;
}

.script-container {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    max-height: 500px;
    overflow-y: auto;
}

.script-content {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 16px;
    color: #2d3748;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.history-controls-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 新的布局样式 */
.history-controls-top {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
}

.history-controls-bottom {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

.select-all-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 16px;
    transition: all 0.3s ease;
}

.select-all-container:hover {
    border-color: #cbd5e0;
    background: #e2e8f0;
}

.select-all-container input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.history-container {
    max-height: 500px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px;
    background: #f7fafc;
}

.history-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.history-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.history-item.selected {
    border-color: #667eea;
    background: #f0f4ff;
}

.history-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    cursor: pointer;
    user-select: none;
}

.history-item-header:hover {
    background: #f8f9fa;
}

.history-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.history-content {
    padding: 0 15px 15px 43px;
}

.history-topic {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
    font-size: 16px;
}

.history-date {
    font-size: 12px;
    color: #a0aec0;
}

.history-script {
    font-size: 14px;
    color: #4a5568;
    background: #f7fafc;
    padding: 15px;
    border-radius: 5px;
    border-left: 3px solid #667eea;
    margin-top: 8px;
    white-space: pre-wrap;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
}

.history-item-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.history-item-actions button {
    padding: 5px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 32px;
    text-align: center;
}

.history-item-actions .copy-btn {
    background: #48bb78;
    color: white;
}

.history-item-actions .copy-btn:hover {
    background: #38a169;
}

.history-item-actions .export-btn {
    background: #4299e1;
    color: white;
}

.history-item-actions .export-btn:hover {
    background: #3182ce;
}

.history-item-actions .delete-btn {
    background: #f56565;
    color: white;
}

.history-item-actions .delete-btn:hover {
    background: #e53e3e;
}

.expand-icon {
    margin-left: 5px;
    transition: transform 0.2s ease;
}

.history-item.expanded .expand-icon {
    transform: rotate(90deg);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 励志语录样式 - 新布局版本 */
.inspiration-section {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0fff0 50%, #e6fffa 100%);
    border-radius: 15px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.15), 0 0 0 1px rgba(72, 187, 120, 0.1);
    position: relative;
    overflow: hidden;
}

.inspiration-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #48bb78, #38a169, #48bb78);
    animation: quoteShimmer 3s ease-in-out infinite;
}

.inspiration-section::after {
    content: '💡';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.3;
    animation: sparkle 2.5s ease-in-out infinite;
}


.quote-icon {
    font-size: 22px;
    animation: sparkle 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(72, 187, 120, 0.3));
    color: #2f855a;
}

.quote-text {
    font-size: 16px;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.5;
    flex-grow: 1;
    font-style: italic;
    transition: opacity 0.3s ease;
    background: rgba(255, 255, 255, 0.4);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(72, 187, 120, 0.15);
}

.refresh-quote {
    background: linear-gradient(45deg, #48bb78, #38a169);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.refresh-quote:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
}

.refresh-quote:active {
    transform: rotate(180deg) scale(1.05);
}

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

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2) rotate(10deg);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    /* 顶部区域移动端布局 */
    .top-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .left-section {
        gap: 15px;
    }

    .right-section {
        /* 移动端保持单列 */
    }

    /* 右侧容器移动端样式 */
    .right-content-wrapper {
        margin-top: 15px;
    }

    .inspiration-section {
        padding: 15px;
    }

    .api-section {
        padding: 15px;
        padding-top: 0;
    }

    /* 倒计时和时钟移动端布局 */
    .countdown-and-clock {
        flex-direction: column;
        gap: 12px;
    }

    header h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }

    header p {
        font-size: 1em;
    }

    .section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .section h2 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 15px;
    }

    .topics-container {
        gap: 12px;
        margin-top: 15px;
        padding: 5px 0;
    }

    .topic-card {
        min-width: 260px;
        max-width: 300px;
        padding: 18px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 15px;
    }

    .controls .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 10px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 14px;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 10px;
    }

    .form-group textarea {
        min-height: 100px;
    }

    .topic-card {
        padding: 20px;
        border-radius: 15px;
    }

    .topic-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
        margin-bottom: 15px;
    }

    .topic-title {
        font-size: 16px;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .topic-description {
        font-size: 15px;
        line-height: 1.6;
    }

    .step {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .step-header h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .prompt-content {
        font-size: 13px;
        padding: 12px;
        max-height: 250px;
    }

    .prompt-controls {
        gap: 8px;
    }

    .prompt-controls .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .script-container {
        padding: 15px;
        max-height: 400px;
        border-radius: 15px;
    }

    .script-content {
        font-size: 15px;
        line-height: 1.7;
    }

    .history-controls {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* 移动端四按钮改为2x2网格布局 */
    .history-controls-top {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 8px;
    }

    .history-controls-top .btn {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 8px;
        font-weight: bold;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 红色和灰色按钮重新分配 */
    .history-controls-top .btn:nth-child(1) {
        background: linear-gradient(45deg, #f56565, #e53e3e); /* 删除选中 - 红色 */
        color: white;
    }

    .history-controls-top .btn:nth-child(2) {
        background: linear-gradient(45deg, #718096, #4a5568); /* 导出选中 - 灰色 */
        color: white;
    }

    .history-controls-top .btn:nth-child(3) {
        background: linear-gradient(45deg, #f56565, #e53e3e); /* 清空历史 - 红色 */
        color: white;
    }

    .history-controls-top .btn:nth-child(4) {
        background: linear-gradient(45deg, #718096, #4a5568); /* 导出全部 - 灰色 */
        color: white;
    }

    /* 底部全选复选框样式 */
    .history-controls-bottom .select-all-container {
        background: #f8f9fa;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .history-controls-bottom .select-all-container:hover {
        border-color: #cbd5e0;
        background: #e2e8f0;
    }

    /* 统一所有按钮样式 */
    .history-controls .btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 8px;
        font-weight: bold;
        transition: all 0.3s ease;
    }

    /* 灰色按钮样式 - 第一排 */
    .history-controls-left .btn.btn-danger {
        background: linear-gradient(45deg, #f56565, #e53e3e);
        color: white;
    }

    /* 红色按钮样式 - 第二排 */
    .history-controls-right .btn.btn-danger {
        background: linear-gradient(45deg, #718096, #4a5568);
        color: white;
    }

    /* 灰色按钮样式 - 第二排 */
    .history-controls-right .btn.btn-secondary {
        background: linear-gradient(45deg, #f56565, #e53e3e);
        color: white;
    }

    /* 按钮悬停效果 */
    .history-controls .btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    /* 按钮禁用状态 */
    .history-controls .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none !important;
    }

    .history-container {
        padding: 10px;
        max-height: 400px;
    }

    .history-item-header {
        padding: 12px 10px;
    }

    .history-topic {
        font-size: 15px;
    }

    .history-script {
        padding: 12px 10px;
        font-size: 14px;
        max-height: 250px;
    }

    .select-all-container {
        font-size: 13px;
    }

    /* 移动端历史记录按钮优化 */
    .history-item-actions {
        gap: 3px;
    }

    .history-item-actions button {
        padding: 4px 6px;
        font-size: 11px;
        min-width: 28px;
    }

    /* 老黄历移动端优化 */
    .calendar-section {
        margin-bottom: 20px;
        padding: 12px 15px;
        border-radius: 12px;
    }

    .calendar-header {
        gap: 6px;
    }

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

    .calendar-title {
        font-size: 16px;
    }

    .calendar-date {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .calendar-info {
        gap: 6px;
    }

    .calendar-item {
        gap: 6px;
    }

    .label {
        min-width: 25px;
        font-size: 14px;
    }

    .suitable,
    .unsuitable {
        font-size: 13px;
        line-height: 1.3;
    }

    .lucky-info {
        gap: 12px;
        margin-top: 6px;
    }

    .lucky-item {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* 励志语录移动端优化 */
    .inspiration-section {
        margin-bottom: 20px;
        padding: 12px 15px;
        border-radius: 12px;
    }

    .quote-content {
        gap: 10px;
        padding: 0 5px;
    }

    .quote-icon {
        font-size: 18px;
        flex-shrink: 0;
    }

    .quote-text {
        font-size: 14px;
        line-height: 1.4;
    }

    .refresh-quote {
        width: 32px;
        height: 32px;
        font-size: 12px;
        flex-shrink: 0;
    }

    /* 进度条移动端优化 */
    .progress-container {
        margin: 0 5px;
        min-width: 120px;
    }

    .progress-bar {
        height: 8px;
        border-radius: 4px;
    }

    .progress-text {
        font-size: 11px;
        min-width: 35px;
    }

    /* 成功提示移动端优化 */
    .success-toast {
        padding: 16px 20px;
        font-size: 14px;
        max-width: 90%;
        text-align: center;
    }

    .success-toast::before {
        font-size: 16px;
    }

    /* 背景切换器移动端优化 */
    #backgroundSwitcher {
        width: 45px !important;
        height: 45px !important;
        top: 15px !important;
        right: 15px !important;
        font-size: 18px !important;
    }
}
}

/* 更小屏幕适配 */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.6em;
    }

    .section {
        padding: 15px 12px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px;
        font-size: 16px;
    }

    .btn {
        padding: 12px 18px;
        font-size: 15px;
    }

    .topic-card {
        padding: 15px;
    }

    .topic-title {
        font-size: 15px;
    }

    .topic-description {
        font-size: 14px;
    }

    /* 励志语录小屏幕适配 */
    .quote-text {
        font-size: 13px;
    }

    .refresh-quote {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    /* 背景切换器小屏幕优化 */
    #backgroundSwitcher {
        width: 40px !important;
        height: 40px !important;
        top: 10px !important;
        right: 10px !important;
        font-size: 16px !important;
    }

    /* 桌面端历史记录布局 - 四按钮均匀分布 */
    .history-controls-top {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .history-controls-top .btn {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 8px;
        font-weight: bold;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .history-controls-bottom .select-all-container {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 12px;
        border-radius: 8px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}