/* ==========================================================================
   墨云阁 · 照片压缩页 (ink-photo.css)
   --------------------------------------------------------------------------
   这是一张全新功能页，没有历史遗留 CSS，所以本文件**不使用 !important**：
   全部直接引用 ink.css 的设计令牌（--ink-accent / --radius* / --paper* / --ink-*），
   靠选择器优先级正常取胜，避免再堆一层覆盖。
   加载顺序：header.php 的 ink.css → 本文件。
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 页面容器 —— 解除主题的两栏网格
   --------------------------------------------------------------------------
   主题 style.css 里 .container 是「主内容 1fr + 260px 侧栏」的 grid。
   功能页没有侧栏，如果不管它，内容会被自动分派进两列（标题一列、
   上传框被挤到右边一列）。video.css / ai.css / music.css 都各自覆盖了
   这一点，新页面同样必须覆盖，否则版式会散掉。
   -------------------------------------------------------------------------- */
.photo-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
}

/* --------------------------------------------------------------------------
   1. 页头（与其它功能页完全一致：1.5rem 墨字 + 三颗点彩）
   -------------------------------------------------------------------------- */
.photo-header {
    margin-bottom: 2rem;
    text-align: center;
}

.photo-header h1 {
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.photo-header p {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin: 0;
}

/* 页头下方一条短线 + 三颗点，与全站一致 */
.photo-header::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--dot-red);
    margin: 1.1rem auto 0;
    box-shadow: 8px 0 0 var(--dot-teal),
                16px 0 0 var(--dot-amber);
    opacity: .85;
}

/* 页头与上传区之间的线稿插图 */
.photo-illo {
    padding: 0 0 0.5rem;
    margin-bottom: 0.5rem;
}

.photo-illo .ink-illus {
    width: 100%;
    max-width: 330px;
    height: auto;
    opacity: .8;
}

/* --------------------------------------------------------------------------
   2. 参数行（默认就是「60KB / 不限边长」，零配置即可用）
   -------------------------------------------------------------------------- */
.photo-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    margin: 0 auto 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.photo-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.photo-option select {
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.45rem;
    cursor: pointer;
    outline: none;
}

.photo-option select:focus {
    border-color: var(--ink-accent-line);
    box-shadow: 0 0 0 3px var(--ink-accent-soft);
}

/* 全部下载 / 清空：安静的次级按钮 */
.photo-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.25rem 0 0;
}

.photo-toolbar[hidden] { display: none; }

/* --------------------------------------------------------------------------
   3. 上传区（细虚线圈 + 纸面底，拖拽时转为朱砂红）
   -------------------------------------------------------------------------- */
.photo-drop {
    position: relative;
    display: block;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--card-bg);
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    transition: border-color 0.18s ease, background-color 0.18s ease;
    cursor: pointer;
}

.photo-drop:hover,
.photo-drop:focus-within {
    border-color: var(--ink-accent-line);
    background: var(--ink-accent-soft);
}

.photo-drop.is-over {
    border-color: var(--ink-accent);
    background: var(--ink-accent-soft);
}

.photo-drop-icon {
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.photo-drop-title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 550;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.photo-drop-hint {
    display: block;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-muted);
}

/* 视觉隐藏但可聚焦的文件输入 */
.photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* 键盘可达性：聚焦时给出朱砂红细环 */
.photo-drop:focus-within {
    outline: none;
}

.photo-drop:focus-within .photo-drop-title {
    color: var(--ink-accent);
}

/* --------------------------------------------------------------------------
   4. 结果卡片
   -------------------------------------------------------------------------- */
.photo-notice {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: center;
}

.photo-notice[hidden] { display: none; }

.photo-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.photo-list:empty { display: none; }

.photo-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.photo-card.is-error {
    border-color: var(--ink-accent-line);
    background: var(--ink-accent-soft);
}

.photo-thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--paper-2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-info {
    flex: 1 1 auto;
    min-width: 0;
}

.photo-name {
    font-size: 0.875rem;
    font-weight: 550;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.photo-chip {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--paper-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.12rem 0.5rem;
    white-space: nowrap;
}

.photo-chip-accent {
    color: var(--ink-accent);
    background: var(--ink-accent-soft);
    border-color: var(--ink-accent-line);
}

.photo-msg {
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.photo-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   5. 按钮（显式声明全部属性，避免继承 ink.css 的全局 button 样式）
   -------------------------------------------------------------------------- */
.photo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 550;
    line-height: 1.4;
    padding: 0.45rem 0.95rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.photo-btn-primary {
    color: #fff;
    background: var(--ink-accent);
    border-color: var(--ink-accent);
}

.photo-btn-primary:hover {
    color: #fff;
    background: var(--ink-accent-hover);
    border-color: var(--ink-accent-hover);
}

.photo-btn-quiet {
    color: var(--text-secondary);
    background: none;
    border-color: var(--border-color);
}

.photo-btn-quiet:hover {
    color: var(--ink-accent);
    background: var(--ink-accent-soft);
    border-color: var(--ink-accent-line);
}

.photo-btn[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

/* 处理中：按钮内的细环 */
.photo-btn .photo-spin {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: photoSpin 0.7s linear infinite;
}

@keyframes photoSpin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   6. 使用说明（与其它功能页同一语汇：朱砂红小图标 + 点彩圆点列表）
   -------------------------------------------------------------------------- */
.photo-tips {
    margin-top: 1.75rem;
    padding: 1.25rem 1.35rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.photo-tips h3 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
}

.photo-tips h3 svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--ink-accent);
    fill: currentColor;
}

.photo-tips ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.photo-tips li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.8125rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.photo-tips li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--dot-teal);
    font-weight: 700;
    font-size: 1.2em;
    line-height: 1.55;
}

.photo-tips strong {
    font-weight: 650;
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   7. 窄屏
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .photo-header h1 { font-size: 1.35rem; }
    .photo-illo .ink-illus { max-width: 250px; }
    .photo-drop { padding: 1.75rem 1rem; }
    .photo-card {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.75rem 0.85rem;
    }
    .photo-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .photo-options { font-size: 0.78125rem; }
}

@media (max-width: 400px) {
    .photo-thumb { width: 46px; height: 46px; }
    .photo-btn { padding: 0.4rem 0.75rem; }
}
