/* DSEG7 Font Definition */
@font-face {
    font-family: 'DSEG7';
    src: url('../../fonts/DSEG7Classic-BoldItalic.woff2') format('woff2');
    font-weight: bold;
    font-style: italic;
    font-display: block;
    unicode-range: U+0020-007F;
}

/* 移动端字体加载优化 */
@media (max-width: 768px) {
    @font-face {
        font-family: 'DSEG7';
        src: url('../../fonts/DSEG7Classic-BoldItalic.woff2') format('woff2');
        font-weight: bold;
        font-style: italic;
        font-display: fallback;
        unicode-range: U+0020-007F;
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 链接样式 */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 按钮基础样式 */
button {
    font-family: inherit;
    cursor: pointer;
}

button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
    background: rgba(0, 123, 255, 0.2);
}

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

::-webkit-scrollbar-track {
    background: var(--page-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--page-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--page-text-secondary);
}

/* 基础工具类 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-scroll {
    overflow: hidden;
} 


/* navigation导航栏基础样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0 1rem;
    transition: background-color 0.3s ease;
}

/* 全屏模式下的隐藏状态 */
.navbar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 网站标题 */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--page-text);
    text-decoration: none;
    transition: color 0.2s ease;
    justify-self: start;
}

.navbar-brand:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* 时钟类型选择器 */
.navbar-clock-selector {
    position: relative;
    justify-self: center;
}

.clock-type-button {
    background: none;
    border: none;
    color: var(--page-text);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 140px;
    justify-content: space-between;
}

.clock-type-button:hover {
    background: var(--page-border);
}

.clock-type-button:focus {
    outline: none;
}

.clock-type-button[aria-expanded="true"] {
    background: var(--page-border);
}

.clock-type-button[aria-expanded="true"] .clock-type-arrow {
    transform: rotate(180deg);
}

.clock-type-text {
    flex: 1;
    text-align: left;
}

.clock-type-arrow {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* 下拉菜单 */
.clock-type-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
    margin-top: 4px;
    overflow: hidden;
}

.clock-type-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.clock-type-option {
    display: block;
    padding: 12px 16px;
    color: var(--page-text);
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.clock-type-option:hover {
    background: var(--page-border);
    text-decoration: none;
}

.clock-type-option.active {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.clock-type-option.active:hover {
    background: rgba(0, 123, 255, 0.15);
}


/* 右侧操作区 */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: end;
}

.navbar-btn {
    background: none;
    border: none;
    color: var(--page-text);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.navbar-btn:hover {
    background: var(--page-border);
    transform: scale(1.05);
}

.navbar-btn:active {
    transform: scale(0.95);
}

.navbar-btn svg {
    width: 20px;
    height: 20px;
}

/* 其他页面隐藏操作区 */
.page-other .navbar-actions {
    display: none;
}

/* 为导航栏预留空间 */
body {
    padding-top: 60px;
    background-color: var(--page-bg);
    color: var(--page-text);
    transition: all 0.3s ease;
}

/* 全屏模式时隐藏导航栏 */
:fullscreen .navbar {
    display: none;
}

:-webkit-full-screen .navbar {
    display: none;
}

:-moz-full-screen .navbar {
    display: none;
}

:-ms-fullscreen .navbar {
    display: none;
}

/* 防息屏按钮样式 */
#stay-on-btn {
    position: relative;
    transition: all 0.3s ease;
}

/* 防息屏按钮激活状态 */
#stay-on-btn.active svg {
    stroke: #0056b3;
}

#stay-on-btn.active {
    background: rgba(0, 86, 179, 0.1);
}

#stay-on-btn.active:hover {
    background: rgba(0, 86, 179, 0.2);
    transform: scale(1.05);
}

/* 防息屏状态指示器 */
.wakelock-status-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.wakelock-status-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.wakelock-status-indicator.success {
    background: rgba(34, 197, 94, 0.9);
}

.wakelock-status-indicator.warning {
    background: rgba(245, 158, 11, 0.9);
}

.wakelock-status-indicator.error {
    background: rgba(239, 68, 68, 0.9);
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding-top: 70px;
    }
    
    /* 移动端导航栏布局调整为两栏 */
    .navbar {
        grid-template-columns: 1fr auto;
        gap: 0.5rem;
        padding: 0 0.75rem;
    }
    
    /* 移动端隐藏Logo */
    .navbar-brand {
        display: none;
    }
    
    /* 时钟选择器在移动端左对齐 */
    .navbar-clock-selector {
        justify-self: start;
    }
    
    .clock-type-button {
        min-width: 120px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    /* 移动端隐藏全屏按钮 */
    #fullscreen-btn {
        display: none !important;
    }
    
    .navbar-actions {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .navbar-actions {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .wakelock-status-indicator {
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        bottom: 15px;
    }
    
    .wakelock-status-indicator.show {
        transform: translateX(-50%) translateY(0);
    }
} 

/* 自定义tooltip样式 */
.custom-tooltip {
    position: fixed;
    z-index: 2000;
    background: rgba(34, 34, 34, 0.95);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    white-space: nowrap;
}
.custom-tooltip.show {
    opacity: 1;
} 