/* ---------------------------------- */
/* Project: Apple-Style Download Site
/* Component: style.css (V1.1)
/* ---------------------------------- */

/* ---------------------------------- */
/* 1. 全局样式 (Apple Aesthetics)     */
/* ---------------------------------- */
:root {
    --color-bg: #f5f5f7;
    /* 苹果浅灰背景 */
    --color-text: #1d1d1f;
    /* 苹果深黑文字 */
    --color-text-secondary: #6e6e73;
    /* 次要文字 */
    --color-blue: #007aff;
    /* 苹果蓝 (链接/高亮) */
    --color-border: #d2d2d7;
    /* 边框/分隔线 */
    --border-radius: 8px;
    /* 全局圆角 */
    --font-family-system: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--font-family-system);
    background-color: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* 【V1.2】 粘性页脚 步骤 1: */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------------------------------- */
/* 2. 布局 (Layout)                  */
/* ---------------------------------- */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;

    /* 【V1.2】 粘性页脚 步骤 2: */
    flex-grow: 1;
}

header {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* 响应式换行 */
    gap: 16px;
    /* 标题和控件之间的间距 */
}

header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

/* 头部控件包裹器 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    /* 搜索框和按钮的间距 */
}

/* 搜索框 (苹果风格) */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

#search-input {
    padding: 9px 12px 9px 36px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 16px;
    font-family: var(--font-family-system);
    background-color: #fff;
    min-width: 250px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

/* 刷新按钮 */
.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    /* 图标大小 */
    width: 40px;
    /* 按钮大小 (高度与搜索框接近) */
    height: 40px;
    /* 按钮大小 */
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    background-color: #fff;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.icon-button:hover {
    border-color: var(--color-blue);
    color: var(--color-blue);
}

.icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
    /* 禁用时移除悬停 */
}

/* 旋转动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.is-refreshing {
    animation: spin 1s linear infinite;
}

/* 【新增 V1.3】 收款/CTA 按钮 */
.cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    /* 与搜索框/刷新按钮高度保持一致 */
    box-sizing: border-box;
    /* 确保 padding 不会破坏高度 */

    font-size: 15px;
    font-weight: 500;
    text-decoration: none;

    color: #fff;
    /* 白字 */
    background-color: var(--color-blue);
    /* 蓝底 */

    border-radius: 20px;
    /* 药丸形状 */
    padding: 0 16px;

    transition: background-color 0.2s;
}

.cta-button:hover {
    background-color: #0070e0;
    /* 悬停时颜色加深 */
}


/* ---------------------------------- */
/* 3. 面包屑导航 (Breadcrumbs)       */
/* ---------------------------------- */
#breadcrumbs {
    margin: 20px 0;
    font-size: 16px;
    color: var(--color-text-secondary);
}

#breadcrumbs a {
    color: var(--color-blue);
    text-decoration: none;
    font-weight: 500;
}

#breadcrumbs a:hover {
    text-decoration: underline;
}

#breadcrumbs span {
    margin: 0 5px;
}

/* ---------------------------------- */
/* 4. 文件列表 (File List)           */
/* ---------------------------------- */
.file-list {
    background-color: #ffffff;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s;
}

.file-list .file-item:last-child {
    border-bottom: none;
}

.file-item:not(.is-folder):hover {
    background-color: #f9f9f9;
}

.file-item.is-folder:hover {
    background-color: rgba(0, 122, 255, 0.05);
}

.file-icon {
    font-size: 24px;
    margin-right: 14px;
    width: 24px;
    text-align: center;
}

.file-name {
    flex: 1;
    /* 占据剩余空间 */
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 文件夹样式 */
.file-item.is-folder .file-name {
    color: var(--color-blue);
    cursor: pointer;
}

/* 文件样式 */
.file-item.is-file .file-name {
    color: var(--color-text);
}

.file-size {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-right: 16px;
    min-width: 80px;
    text-align: right;
}

/* 下载按钮 (苹果风格) */
.download-button {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--color-blue);
    background-color: rgba(0, 122, 255, 0.1);
    border-radius: 20px;
    padding: 6px 14px;
    transition: background-color 0.2s;
}

.download-button:hover {
    background-color: rgba(0, 122, 255, 0.15);
}

.download-button span {
    margin-right: 6px;
    /* Emoji 和文字的间距 */
}

/* 加载和错误提示 */
#loading,
#error {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--color-text-secondary);
}

#no-results {
    display: none;
    /* 默认隐藏 */
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--color-text-secondary);
}

/* ---------------------------------- */
/* 5. 页脚 (Footer)                  */
/* ---------------------------------- */
footer {
    flex-shrink: 0;
    margin-top: 40px;
    padding-bottom: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* 方案 E: 彩蛋透明链接 */
.easter-egg-link {
    text-decoration: none;
    color: transparent;
    /* 隐藏文字 */
    font-size: 1px;
    /* 极小，使其几乎不占空间 */
    width: 1px;
    display: inline-block;
}

.easter-egg-link:focus {
    color: var(--color-blue);
    font-size: 12px;
    width: auto;
}
/* ---------------------------------- */
/* 6. 模态窗口 (Sponsor Modal)       */
/* ---------------------------------- */

/* 模态窗口背景 (半透明黑色遮罩) */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 10; /* 确保在最顶层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    /* 遮罩层 */
    backdrop-filter: blur(4px);
    /* 磨砂玻璃效果，如果浏览器支持 */
}

/* 模态窗口内容 */
.modal-content {
    background-color: #fefefe;
    /* 白色背景 */
    margin: 15% auto;
    /* 垂直居中 */
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    /* 默认宽度 */
    max-width: 400px;
    /* 最大宽度 */
    border-radius: var(--border-radius);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    /* 轻微阴影 */
    text-align: center;
}

/* 关闭按钮 */
.close-button {
    color: var(--color-text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    /* 调整位置 */
}

.close-button:hover,
.close-button:focus {
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
}

/* 标题 */
.modal-content h2 {
    font-weight: 600;
    font-size: 24px;
    margin-top: 0;
    color: var(--color-blue);
}

/* 收款码图片 */
.skm-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 15px 0;
    border: 1px solid var(--color-border);
    /* 增加一个细边框 */
}

/* 提示文字 */
.skm-tip {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 0;
}
/* ---------------------------------- */
/* 7. 文件操作 (File Actions)        */
/* ---------------------------------- */

/* 文件操作容器：使两个按钮并排 */
.file-actions {
    display: flex;
    align-items: center;
    gap: 8px; /* 两个按钮之间的间距 */
}

/* 复制链接按钮 */
.copy-link-button {
    /* 与下载按钮保持一致的高度和圆角 */
    height: 32px;
    box-sizing: border-box;

    font-size: 14px;
    font-weight: 500;
    text-decoration: none;

    color: var(--color-blue);
    background-color: rgba(0, 122, 255, 0.05); /* 比下载按钮更浅一点 */
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap; /* 防止按钮内文本换行 */
}

.copy-link-button:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

/* 复制成功提示样式 */
.copy-link-button.copied {
    background-color: #28a745; /* 绿色背景 */
    color: #fff; /* 白色文字 */
    pointer-events: none; /* 复制过程中禁用再次点击 */
}

/* 复制失败提示样式 */
.copy-link-button.failed {
    background-color: #dc3545; /* 红色背景 */
    color: #fff;
    pointer-events: none;
}

/* 调整下载按钮的样式以适应新的容器 */
.file-actions .download-button {
    /* 取消 margin-right，由 .file-actions 的 gap 控制 */
    margin-right: 0;
}