/* ==================== Normalize (精简) ==================== */
*,*::before,*::after{box-sizing:border-box}
html{line-height:1.15;-webkit-text-size-adjust:100%}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:16px;color:#333;background:#fff}
h1{font-size:2em;margin:.67em 0}
a{background-color:transparent;color:inherit;text-decoration:none}
img{border-style:none;max-width:100%}
button,input,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}
button,input{overflow:visible}
button,select{text-transform:none}
button{-webkit-appearance:button;cursor:pointer}

/* ==================== 通用工具类 ==================== */
.text-center{text-align:center}
.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}

/* ==================== 容器布局 ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==================== 首页工具列表 ==================== */
#app {
    background: #F6F6F6;
    min-height: 100vh;
    position: relative;
}

/* 首页右上角登录/登出入口 */
.top-bar {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 10;
}

.top-bar .top-user {
    color: #666;
    max-width: 120px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.top-bar .top-link {
    color: #4E6EF2;
}

.top-bar .top-link:hover {
    text-decoration: underline;
}

.page-title {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: #191919;
    margin: 0;
}

.tools-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0 20px 40px;
}

.tool-card {
    box-shadow: 0 0 12px rgba(0, 0, 0, .12);
    display: flex;
    padding: 15px;
    align-items: center;
    border-radius: 8px;
    background: #ffffff;
    text-decoration: none;
    transition: box-shadow .2s ease, transform .2s ease;
    /* 桌面端：一行3个 */
    width: calc(33.333% - 14px);
}

.tool-card:hover {
    box-shadow: 0 0 12px rgba(0, 0, 0, .24);
    transform: translateY(-2px);
}

.tool-card .card-icon {
    width: 44px;
    height: 44px;
    border: 1px solid #f1f1f1;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 24px;
    line-height: 1;
}

.tool-card .card-info {
    margin-left: 10px;
    overflow: hidden;
}

.tool-card .card-title {
    color: #191919;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-card .card-desc {
    color: #a1a7b7;
    font-size: 14px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ==================== 短链页面 ==================== */
.short-page {
    min-height: 100vh;
    background: #F6F6F6;
}

.short-create {
    padding-top: 120px;
    margin: 0 20px;
}

.short-create h1 {
    margin-bottom: 20px;
    text-align: center;
    font-size: 32px;
    color: #191919;
}

.input-group {
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #C4C7CE;
    border-radius: 8px;
    display: flex;
    align-items: center;
    height: 44px;
    background: #fff;
    overflow: hidden;
}

.input-group input {
    border: none;
    width: 100%;
    font-size: 14px;
    padding: 0 16px;
    outline: none;
    height: 100%;
}

.input-group button {
    height: 100%;
    background: #4E6EF2;
    color: #ffffff;
    padding: 0 20px;
    border: none;
    border-radius: 0 7px 7px 0;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

.input-group button:hover {
    background: #3d5ce0;
}

.error-tips {
    text-align: center;
    font-size: 12px;
    margin-top: 8px;
    color: #e74c3c;
}

.short-result {
    max-width: 500px;
    margin: 60px auto 0;
    padding: 0 20px;
}

.short-result .result-card {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #C4C7CE;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 0 12px rgba(0, 0, 0, .08);
    padding: 24px;
    flex-wrap: wrap;
    gap: 8px;
}

.short-result .result-label {
    font-weight: bold;
    color: #333;
}

.short-result .result-url {
    text-decoration: underline;
    color: #4e6ef2;
    word-break: break-all;
    cursor: pointer;
}

.short-result .copy-btn {
    color: #4e6ef2;
    cursor: pointer;
    margin-left: 8px;
    font-size: 14px;
}

.short-result .copy-btn:hover {
    text-decoration: underline;
}

/* ==================== 登录页 ==================== */
.login-page {
    min-height: 100vh;
    background: #F6F6F6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 0, 0, .08);
    padding: 32px;
}

.login-card h1 {
    margin: 0 0 24px;
    text-align: center;
    font-size: 28px;
    color: #191919;
}

.login-item {
    margin-bottom: 16px;
}

.login-item label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.login-item input {
    width: 100%;
    height: 44px;
    border: 1px solid #C4C7CE;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.login-item input:focus {
    border-color: #4E6EF2;
}

.login-btn {
    width: 100%;
    height: 44px;
    margin-top: 8px;
    background: #4E6EF2;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
}

.login-btn:hover {
    background: #3d5ce0;
}

.login-error {
    margin-top: 12px;
}

.login-back {
    display: block;
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
    color: #4E6EF2;
}

.login-back:hover {
    text-decoration: underline;
}

/* ==================== 响应式布局 ==================== */

/* 平板端 (768px - 1199px): 一行2个 */
@media only screen and (max-width: 1199px) {
    .tool-card {
        width: calc(50% - 10px);
    }
}

/* 手机端 (< 768px): 一行1个 */
@media only screen and (max-width: 767px) {
    .page-title {
        height: 120px;
        font-size: 32px;
        padding-top: 0;
    }

    .tools-grid {
        padding: 0 16px 20px;
        gap: 12px;
    }

    .tool-card {
        width: 100%;
    }

    .short-create {
        padding-top: 60px;
    }

    .short-create h1 {
        font-size: 24px;
    }

    .input-group {
        height: 40px;
    }

    .input-group input {
        font-size: 13px;
        padding: 0 12px;
    }

    .input-group button {
        padding: 0 14px;
        font-size: 13px;
    }

    .short-result {
        margin-top: 30px;
    }

    .short-result .result-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .short-result .copy-btn {
        margin-left: 0;
        margin-top: 4px;
    }

    .top-bar {
        top: 10px;
        right: 12px;
        font-size: 13px;
    }

    .login-card {
        max-width: none;
        padding: 24px 20px;
        box-shadow: none;
        border: 1px solid #ebebeb;
    }

    .login-card h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .login-item input {
        height: 42px;
        font-size: 13px;
    }
}
