/* 全局CSS变量定义 */
:root {
    /* 明亮主题 */
    --bg-color: #ffffff;
    --text-color: #000000;
    --secondary-text: #7b7b7b;
    --primary-color: #1E90FF;
    --primary-hover: #1C86EE;
    --border-color: #bfbfbf;
    --bar-color: #1E90FF;
    --input-bg: #ffffff;
    --input-text: #000000;
    --btn-bg: #1E90FF;
    --btn-text: #fff;
    --tips-color: #7b7b7b;
    --docker-tip-color: #7b7b7b;
    --docker-link-color: #1E90FF;
    --docker-link-hover: #1C86EE;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --theme-toggle-bg: #e1e4e8;
    --theme-toggle-icon: #6a737d;
}

[data-theme="dark"] {
    /* 黑暗主题 */
    --bg-color: #0d1117;
    --text-color: #c9d1d9;
    --secondary-text: #8b949e;
    --primary-color: #58a6ff;
    --primary-hover: #316dca;
    --border-color: #30363d;
    --bar-color: #58a6ff;
    --input-bg: #0d1117;
    --input-text: #c9d1d9;
    --btn-bg: #238636;
    --btn-text: #ffffff;
    --tips-color: #8b949e;
    --docker-tip-color: #8b949e;
    --docker-link-color: #58a6ff;
    --docker-link-hover: #316dca;
    --card-bg: #161b22;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --theme-toggle-bg: #30363d;
    --theme-toggle-icon: #8b949e;
}

html,body {
    width: 100%;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    height: 100%
}

body {
    min-height: 100%;
    padding: 20px 20px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

p {
    word-break: break-all
}

.flex {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center
}

.block {
    display: block;
    position: relative
}

.url {
    font-size: 18px;
    padding: 10px 10px 10px 5px;
    position: relative;
    width: 400px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--input-text);
    transition: all 0.3s ease;
}

input:focus {
    outline: 0
}

.bar {
    content: '';
    height: 2px;
    width: 100%;
    bottom: 0;
    position: absolute;
    background: var(--bar-color);
    transition: .2s ease transform;
    -moz-transition: .2s ease transform;
    -webkit-transition: .2s ease transform;
    transform: scaleX(0)
}

.url:focus ~ .bar {
    transform: scaleX(1)
}

.btn {
    line-height: 38px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    white-space: nowrap;
    text-align: center;
    font-size: 14px;
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    padding: 5px;
    width: 160px;
    margin: 30px 0;
    transition: background-color 0.3s ease;
}

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

/* 导航栏 */
.navbar {
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin: 0;
}

.navbar li {
    margin: 0;
}

.nav-link {
    display: inline-block;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--theme-toggle-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    fill: var(--theme-toggle-icon);
}

/* 评论区 */
.comments {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 40px;
    width: 100%;
    max-width: 800px;
    transition: all 0.3s ease;
}

h2 {
    color: var(--text-color);
    margin-bottom: 20px;
}

/* 响应式设计 */
@media(max-width: 768px) {
    /* 移动端优化：第一屏只展示核心内容 */
    .tips,
    .example {
        display: none;
    }
    
    .url {
        width: 300px;
    }
}

/* 桌面端完整显示所有内容 */
@media(min-width: 769px) {
    .tips,
    .example {
        display: block;
        color: var(--tips-color);
        position: relative;
        align-self: flex-start;
        margin-left: 7.5em;
    }
    
    .tips>p:first-child::before {
        position: absolute;
        left: -3em;
        content: 'PS：';
        color: var(--tips-color);
    }
    
    .example>p:first-child::before {
        position: absolute;
        left: -7.5em;
        content: '合法输入示例：';
        color: var(--tips-color);
    }
}