/* 时区转换器专用样式 */


/* 源时间输入区域 */
/* 时区输入区域 - 仿照ssl-check样式 */
.timezone-input-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* 输入模式 Tab 切换 */
.input-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0;
}

.input-mode-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.input-mode-tab:hover {
    color: white;
    background: var(--accent-color);
    cursor: pointer;
}

.input-mode-tab.active {
    border-bottom-color: var(--accent-light);
    font-weight: 600;
}

.input-mode-tab span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.input-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.input-field {
    flex: 1;
}

.timezone-field {
    flex: 0 0 220px;
}

.input-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-field input,
.input-field select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-field input:focus,
.input-field select:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(222, 222, 222, 0.1);
}

.input-field input::placeholder {
    color: var(--text-tertiary);
}

.input-field input[readonly] {
    cursor: pointer;
    background: var(--bg-primary);
}

.input-field input[readonly]:hover {
    border-color: var(--accent-light);
}

.datetime-display {
    cursor: pointer;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s ease;
}

.datetime-display:hover {
    border-color: var(--accent-hover);
}

.datetime-display:focus {
    outline: none;
    border-color: var(--accent-hover);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* 时区网格显示区域 */
.timezone-grid-section {
    margin-bottom: 32px;
}

.timezone-grid-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.timezone-info {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.working-hours-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.source-timezone-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--warning-color);
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--warning-color);
}

.dst-indicator {
    padding: 2px 8px;
    background: var(--warning-color);
    color: var(--bg-primary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 时区网格布局 */
.timezone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

/* 时区卡片样式 */
.timezone-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.timezone-card.rest-hours:hover {
    border-color: var(--accent-light);
}

.timezone-card:hover {
    border-color: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.timezone-card.working-hours {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.timezone-card.working-hours::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--success-color);
}

.timezone-card.rest-hours {
    background: rgba(107, 114, 128, 0.05);
    border-color: rgba(107, 114, 128, 0.1);
}

.timezone-card.source-timezone {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning-color);
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.timezone-card.source-timezone::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--warning-color), rgba(245, 158, 11, 0.6));
    border-radius: 10px;
    z-index: -1;
    opacity: 0.3;
}

/* 拖拽手柄 */
.drag-handle {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 16px;
    color: var(--text-tertiary);
    cursor: grab;
    opacity: 0;
    transition: opacity 0.2s ease;
    user-select: none;
    z-index: 10;
    padding: 4px;
    line-height: 1;
}

.timezone-card:hover .drag-handle {
    opacity: 0.6;
}

.drag-handle:hover {
    opacity: 1 !important;
    color: var(--accent-light);
}

.drag-handle:active {
    cursor: grabbing;
}

/* 当卡片有DST标签时，调整拖拽手柄位置 */
.timezone-card.has-dst .drag-handle {
    bottom: 16px; /* 移到DST标签上方 */
    right: 60px;
}

/* 拖拽状态 */
.timezone-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.timezone-card.drag-over {
    border-color: var(--accent-light);
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--accent-color);
}

/* 时区卡片内容 */
.timezone-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.timezone-city {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.2;
}

.timezone-utc-offset {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 8px;
}

.timezone-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.timezone-code {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
}

.timezone-time {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-family-mono);
    margin-bottom: 4px;
}

.timezone-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.dst-badge {
    background: var(--warning-color);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* 复制提示 */
.timezone-card .copy-tooltip {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border: 1px solid var(--border-color);
    z-index: 10;
}

.timezone-card.copying .copy-tooltip {
    opacity: 1;
}

/* 日期时间选择器样式 */
.datetime-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.datetime-picker-overlay.active {
    display: flex;
}

.datetime-picker-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
}

.datetime-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.datetime-picker-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.datetime-picker-body {
    display: flex;
    height: 400px;
}

/* 日历部分 */
.calendar-section {
    flex: 2;
    padding: 20px;
    border-right: 1px solid var(--border-color);
}

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

.nav-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.calendar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday {
    text-align: center;
    padding: 8px 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    text-align: center;
    padding: 8px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.calendar-day:hover {
    background: var(--bg-primary);
}

.calendar-day.selected {
    background-color: var(--accent-light);
    color: var(--bg-primary);
    font-weight: 600;
}

.calendar-day.other-month {
    color: var(--text-tertiary);
}

.calendar-day.today {
    background-color: var(--bg-secondary);
    font-weight: 600;
    border: 2px solid var(--accent-color);
}

.calendar-day.today.selected {
    background-color: var(--accent-light);
    color: var(--bg-primary);
}

/* 时间选择部分 */
.time-section {
    flex: 1;
    padding: 20px;
    display: flex;
    gap: 12px;
}

.time-column {
    flex: 1;
    text-align: center;
}

.time-column label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.time-scroll {
    height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
}

.time-item {
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-primary);
}

.time-item:hover {
    background-color: var(--border-color);
}

.time-item.selected {
    background-color: var(--accent-light);
    color: var(--bg-primary);
    font-weight: 600;
}

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

/* 时间滚动条样式 */
.time-scroll::-webkit-scrollbar {
    width: 6px;
}

.time-scroll::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.time-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.time-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.datetime-picker-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--bg-tertiary);
}

/* 响应式设计 */
@media (max-width: 1300px) {
    .timezone-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 12px;
    }
    
    .input-row {
        gap: 12px;
    }
    
    .timezone-field {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .timezone-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
    }
    
    .timezone-card {
        padding: 12px;
    }
    
    .timezone-time {
        font-size: 1.1rem;
    }
    
    .timezone-city {
        font-size: 0.9rem;
    }
    
    .timezone-utc-offset {
        font-size: 0.7rem;
        padding: 1px 6px;
    }
    
    
    .datetime-picker-panel {
        width: 95%;
        max-width: none;
    }
    
    .datetime-picker-body {
        flex-direction: column;
        height: auto;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    .calendar-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .time-section {
        padding: 16px 20px;
    }
    
    .timezone-grid-section .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .timezone-grid {
        grid-template-columns: 1fr;
    }
    
    
    .timezone-input-section {
        padding: 16px;
    }
    
    .input-row {
        gap: 10px;
    }
}

/* ============================================
   时区筛选面板样式
   ============================================ */

/* 筛选按钮 */
.timezone-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 14px;
    white-space: nowrap;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--accent-color);
    color: var(--bg-primary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.filter-count:empty {
    display: none;
}

/* Header 右侧布局 */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* 筛选面板遮罩 */
.timezone-filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.timezone-filter-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 筛选面板 */
.timezone-filter-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 筛选面板头部 */
.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.filter-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 筛选面板主体 */
.filter-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* 筛选操作按钮组 */
.filter-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* 搜索框 */
.filter-search {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(222, 222, 222, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

/* 筛选列表 */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

/* 时区选项 */
.timezone-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timezone-option:hover {
    background: var(--bg-hover);
    border-color: var(--border-color);
}

.timezone-option.selected {
    background: var(--bg-tertiary);
    border-color: var(--accent-light);
}

.timezone-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--accent-light);
}

.timezone-option-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
}

.timezone-option-city {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.timezone-option-id {
    font-size: 12px;
    color: var(--text-secondary);
}

.timezone-option-offset {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-left: 8px;
    white-space: nowrap;
}

/* 筛选面板底部 */
.filter-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .timezone-filter-panel {
        width: 95%;
        max-height: 90vh;
    }
    
    .filter-header,
    .filter-body,
    .filter-footer {
        padding: 16px;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions .btn-sm {
        width: 100%;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .timezone-info {
        flex-wrap: wrap;
        gap: 8px;
    }
}
