/**
 * 开发者工具箱 - 样式表
 * @author Shijie Zhao
 * @version 2.0
 */

/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== 全局样式 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    max-width: 1300px;
    width: 100%;
}

/* ========== 主布局 ========== */
.main-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* ========== 左侧导航面板 ========== */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px 12px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar-title {
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== 导航分组 ========== */
.nav-group {
    margin-bottom: 16px;
}

.nav-group-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 10px;
    margin-bottom: 8px;
}

.nav-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    margin-bottom: 4px;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-item-icon {
    display: inline-block;
    width: 20px;
    text-align: center;
    margin-right: 8px;
}

/* ========== 右侧内容区 ========== */
.content-area {
    flex: 1;
    min-width: 0;
}

/* ========== 玻璃卡片 ========== */
.glass-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    margin-bottom: 20px;
}

/* ========== 标题 ========== */
h1 {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
}

/* ========== 表单元素 ========== */
.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

input, select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

select {
    cursor: pointer;
}

select option {
    background: #667eea;
    color: white;
}

/* ========== 按钮 ========== */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

button {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

button:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.28));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

/* ========== 结果区域 ========== */
.result-section {
    display: none;
}

.result-section.show {
    display: block;
    animation: slideIn 0.5s ease-out;
}

.result-section h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.copy-all-btn {
    font-size: 14px;
    padding: 8px 16px;
    flex: none;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.3s ease-out forwards;
    opacity: 0;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.result-item:nth-child(1) { animation-delay: 0.05s; }
.result-item:nth-child(2) { animation-delay: 0.1s; }
.result-item:nth-child(3) { animation-delay: 0.15s; }
.result-item:nth-child(4) { animation-delay: 0.2s; }
.result-item:nth-child(5) { animation-delay: 0.25s; }
.result-item:nth-child(6) { animation-delay: 0.3s; }
.result-item:nth-child(7) { animation-delay: 0.35s; }
.result-item:nth-child(8) { animation-delay: 0.4s; }
.result-item:nth-child(9) { animation-delay: 0.45s; }
.result-item:nth-child(10) { animation-delay: 0.5s; }
.result-item:nth-child(11) { animation-delay: 0.55s; }

.result-item.copied .copy-overlay {
    animation: copiedOverlay 0.9s ease-out forwards;
}

.result-item.copied .copy-burst {
    opacity: 1;
    animation: burst 0.7s ease-out forwards;
}

.result-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.label-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.result-value {
    color: white;
    font-size: 16px;
    font-weight: 600;
    word-break: break-all;
}

.result-value.mono {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 14px;
}

.result-value pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
}

/* ========== 复制动画效果 ========== */
.copy-overlay {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(90deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.12) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: scale(0.98);
    will-change: opacity, transform;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

.copy-burst {
    position: absolute;
    inset: -30%;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.55) 0 8%, transparent 9 100%),
        radial-gradient(circle at 80% 25%, rgba(255,255,255,0.45) 0 6%, transparent 7 100%),
        radial-gradient(circle at 70% 70%, rgba(255,255,255,0.5) 0 7%, transparent 8 100%),
        radial-gradient(circle at 30% 75%, rgba(255,255,255,0.4) 0 5%, transparent 6 100%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.3) 0 12%, transparent 13 100%);
    filter: blur(0.5px);
    transform: scale(0.5);
    will-change: opacity, transform, filter;
}

/* ========== 提示消息 ========== */
.error {
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.4);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.error.show {
    display: block;
}

.success {
    background: rgba(52, 199, 89, 0.2);
    border: 1px solid rgba(52, 199, 89, 0.4);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.success.show {
    display: block;
}

/* ========== 标签页 ========== */
.tabs {
    display: none;
}

.tab {
    display: none;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.tab-content.active {
    display: block;
}

/* ========== 快捷键提示 ========== */
.shortcut-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    margin-top: 15px;
}

.shortcut-hint kbd {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
}

/* ========== ASCII表格 ========== */
.ascii-table {
    margin-top: 18px;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.ascii-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: white;
    min-width: 720px;
}

.ascii-table th,
.ascii-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    white-space: nowrap;
}

.ascii-table th {
    background: rgba(255, 255, 255, 0.15);
    font-weight: 700;
}

.ascii-table tr:last-child td {
    border-bottom: none;
}

.ascii-table .mono {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 12px;
}

.ascii-table th:nth-child(4n+1),
.ascii-table th:nth-child(4n+2),
.ascii-table th:nth-child(4n+3),
.ascii-table th:nth-child(4n+4),
.ascii-table td:nth-child(4n+1),
.ascii-table td:nth-child(4n+2),
.ascii-table td:nth-child(4n+3),
.ascii-table td:nth-child(4n+4) {
    background: rgba(255, 255, 255, 0.06);
}

.ascii-table th:nth-child(8n+1),
.ascii-table th:nth-child(8n+2),
.ascii-table th:nth-child(8n+3),
.ascii-table th:nth-child(8n+4),
.ascii-table td:nth-child(8n+1),
.ascii-table td:nth-child(8n+2),
.ascii-table td:nth-child(8n+3),
.ascii-table td:nth-child(8n+4) {
    background: rgba(255, 255, 255, 0.22);
}

.ascii-table th:nth-child(4n),
.ascii-table td:nth-child(4n) {
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.22);
}

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: white;
}

.footer .heart {
    color: #ff6b6b;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* ========== 动画 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes burst {
    0% {
        opacity: 0.9;
        transform: scale(0.4);
        filter: blur(0px);
    }
    70% {
        opacity: 0.5;
        transform: scale(1.1);
        filter: blur(1px);
    }
    100% {
        opacity: 0;
        transform: scale(1.6);
        filter: blur(2px);
    }
}

@keyframes copiedOverlay {
    0% {
        opacity: 0;
        transform: scale(0.97);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    70% {
        opacity: 0.7;
        transform: scale(1.01);
    }
    100% {
        opacity: 0;
        transform: scale(1.02);
    }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========== 响应式布局 ========== */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        max-height: none;
        padding: 15px;
        margin-bottom: 0;
    }

    .nav-groups-container {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-group {
        margin-bottom: 0;
        flex: 1;
        min-width: 150px;
    }

    .nav-group-title {
        margin-bottom: 6px;
    }

    .nav-item {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .glass-card {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .sidebar {
        padding: 12px;
    }

    .sidebar-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .nav-groups-container {
        gap: 6px;
    }

    .nav-group {
        min-width: calc(50% - 4px);
    }

    .nav-item {
        padding: 6px 8px;
        font-size: 11px;
        margin-bottom: 2px;
    }

    .nav-item-icon {
        display: none;
    }

    .button-group {
        flex-wrap: wrap;
    }

    .button-group button {
        min-width: calc(50% - 6px);
    }

    .copy-overlay {
        font-size: 13px;
    }
}
