/* 现代重置与全局变量 */
:root {
    --primary-color: #4f46e5;       /* 现代科技感紫色/蓝色 */
    --primary-hover: #4338ca;
    --success-color: #10b981;       /* 成功/计算按钮绿色 */
    --success-hover: #059669;
    --danger-color: #ef4444;        /* 清空按钮红色 */
    --danger-hover: #dc2626;
    --bg-color: #f8fafc;            /* 浅灰蓝色背景，更显高级 */
    --card-bg: #ffffff;
    --text-main: #1e293b;           /* 深色主文本 */
    --text-muted: #64748b;          /* 辅助灰色文本 */
    --border-color: #e2e8f0;
    --radius: 12px;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft Yahei", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    vertical-align: middle;
    border-radius: 8px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* 布局容器 */
.wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container {
    margin-bottom: 30px;
}

/* 顶部导航 */
.mod-head {
    padding: 0 0 20px 0;
    text-align: right;
}
.mod-head a {
    font-size: 14px;
    font-weight: 500;
}

/* 主面板卡片化 */
.mod-panel {
    width: 100%;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* 头部标题区 */
.mod-panel .hd {
    margin-bottom: 35px;
    text-align: center;
}

.mod-panel .hd h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mod-panel .hd p {
    font-size: 15px;
    color: var(--text-muted);
}

/* 主体表单区 */
.mod-panel .bd {
    max-width: 600px;
    margin: 0 auto;
}

.mod-panel .row {
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 12px 20px;
    border-radius: 8px;
}

.mod-panel .field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-weight: 500;
    color: var(--text-main);
}

/* 单选框美化 */
.mod-panel label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-right: 20px;
    user-select: none;
}

.mod-panel label input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    outline: none;
    margin-right: 6px;
    transition: all 0.2s ease;
    display: inline-block;
    vertical-align: middle;
}

.mod-panel label input[type="radio"]:checked {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    box-shadow: inset 0 0 0 3px #fff;
}

/* 文本域美化 */
.mod-panel textarea {
    display: block;
    width: 100%;
    height: 110px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-main);
    background-color: #fff;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
    margin-top: 10px;
    margin-bottom: 15px;
}

.mod-panel textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

#reslut {
    background-color: #f8fafc;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
}

/* 快速选择按钮组 */
.mod-panel .bd p {
    margin-bottom: 20px;
}

.mod-panel label {
    font-weight: 500;
    color: var(--text-muted);
}

.mod-panel p span {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* 关系快捷键小按钮 */
.mod-panel .btn {
    width: auto;
    min-width: 46px;
    height: 36px;
    padding: 0 10px;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.mod-panel .btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.mod-panel .btn:disabled {
    background: #f1f5f9;
    color: #cbd5e1;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* 底部操作大按钮（回退、清空、计算） */
.mod-panel .input-button {
    height: 42px;
    width: calc(33.33% - 10px);
    margin: 10px 10px 20px 0;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 分别为三个按钮赋予现代配色 */
.mod-panel .input-button:nth-of-type(1) { background-color: #64748b; } /* 回退 灰色 */
.mod-panel .input-button:nth-of-type(1):hover { background-color: #475569; }

.mod-panel .input-button:nth-of-type(2) { background-color: var(--danger-color); } /* 清空 红色 */
.mod-panel .input-button:nth-of-type(2):hover { background-color: var(--danger-hover); }

.mod-panel .input-button:nth-of-type(3) { background-color: var(--success-color); width: calc(33.33% + 10px); margin-right: 0;} /* 计算 绿色 */
.mod-panel .input-button:nth-of-type(3):hover { background-color: var(--success-hover); }

/* 底部文字说明区 */
.mod-panel .ft {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.mod-panel .ft p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
    text-align: justify;
}

/* 悬浮二维码及说明区 */
.mod-qrcode, .mod-my {
    position: fixed;
    bottom: 30px;
    background: #fff;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: transform 0.2s ease;
}
.mod-qrcode:hover, .mod-my:hover {
    transform: translateY(-5px);
}

.mod-qrcode { right: 30px; }
.mod-my { left: 30px; }

.mod-qrcode .box, .mod-my .box {
    margin-bottom: 8px;
}

.mod-qrcode p, .mod-my p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 移动端响应式深度优化 */
@media screen and (max-width: 1024px) {
    .mod-qrcode, .mod-my {
        position: static;
        width: 100%;
        max-width: 280px;
        margin: 20px auto 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }
}

@media screen and (max-width: 600px) {
    .wrapper {
        padding: 15px 10px;
    }
    .mod-panel {
        padding: 20px 15px;
    }
    .mod-panel .hd h1 {
        font-size: 24px;
    }
    .mod-panel .row {
        padding: 10px 12px;
        margin-bottom: 12px;
    }
    .mod-panel .field {
        font-size: 14px;
    }
    .mod-panel label {
        margin-right: 10px;
        margin-top: 4px;
    }
    .mod-panel textarea {
        height: 90px;
    }
    .mod-panel p span {
        margin-right: 4px;
        margin-bottom: 4px;
    }
    .mod-panel .btn {
        min-width: 42px;
        height: 34px;
        font-size: 13px;
        padding: 0 6px;
    }
    .mod-panel .input-button {
        font-size: 14px;
        height: 38px;
    }
}