/* Laskuri.fi - 改进的CSS样式，融合ym源码的优秀特点 */

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

body {
    font-family: arial, helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    background-color: #f5f5f5;
}

/* 头部样式 - 参考ym的简洁设计 */
#headerout {
    background: #336699;
    border-bottom: 1px solid #225588;
    padding: 0;
    margin: 0;
}

#header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#logo {
    color: white;
    font-weight: bold;
    font-size: 16px;
}

#login {
    color: white;
    font-size: 13px;
}

#login a {
    color: white;
    text-decoration: none;
}

#login a:hover {
    text-decoration: underline;
}

/* 内容区域 */
#contentout {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 600px;
    display: flex;
    gap: 20px;
    padding: 15px;
}

#content {
    flex: 1;
    padding-right: 20px;
}

#right {
    width: 336px;
    flex-shrink: 0;
}

/* 面包屑导航 - 参考ym的结构化设计 */
#breadcrumbs {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    padding: 5px 0;
}

#breadcrumbs a {
    color: #336699;
    text-decoration: none;
}

#breadcrumbs a:hover {
    text-decoration: underline;
}

/* 打印链接 */
#printit {
    width: 80px;
    float: right;
    text-align: right;
    font-size: 12px;
}

#printit a {
    color: #336699;
    text-decoration: none;
}

/* 标题 */
h1 {
    color: #0d233a;
    font-size: 24px;
    margin: 15px 0;
    font-weight: bold;
}

h2 {
    color: #0d233a;
    font-size: 20px;
    margin: 15px 0 10px 0;
}

h3 {
    color: #0d233a;
    font-size: 16px;
    margin: 12px 0 8px 0;
}

h4 {
    color: #0d233a;
    font-size: 14px;
    margin: 10px 0 6px 0;
    font-weight: bold;
}

/* 指令横幅 - 参考ym的视觉设计 */
#insmdc {
    text-align: center;
    margin: 15px 0;
}

/* 面板样式 - 完全参考ym源码的panel设计 */
.panel {
    background: #eeeeee;
    border: 1px solid #bbbbbb;
    padding: 5px;
}

/* ym源码的核心布局类 - 完全复制 */
.leftinput {
    width: 325px;
    float: left;
}

.rightresult {
    width: 375px;
    float: right;
}

.clefthalf {
    width: 350px;
    float: left;
}

.crighthalf {
    width: 350px;
    float: right;
}

.espaceforM {
    display: none;
}

#clear {
    margin-left: auto;
    margin-right: auto;
    clear: both;
    height: 0px;
}

/* 结果框样式 - 参考ym的result_box */
.result_box {
    background: #e3edda;
    border: 1px solid #8db46d;
    padding: 8px 15px;
    text-align: center;
    margin-bottom: 15px;
    border-radius: 3px;
}

.h2result {
    background: #518428;
    color: white;
    border: none;
    padding: 8px 15px;
    margin: -8px -15px 15px -15px;
    font-size: 16px;
    font-weight: bold;
    position: relative;
}

.rightresult {
    margin-bottom: 20px;
}

.espaceforM {
    height: 10px;
}

/* 表格样式 - 100%复制ym源码的cinfoT设计 */
table.cinfoT {
    border-collapse: collapse;
    border-spacing: 0px;
    margin-top: 0px;
    width: 100%;
}

table.cinfoT th, table.cinfoT td.cinfoHd, table.cinfoT td.cinfoHdL {
    border-width: 1px;
    border-style: solid;
    border-color: rgb(17, 68, 119) rgb(17, 68, 119) rgb(51, 102, 153);
    background-color: rgb(51, 102, 153);
    font-weight: bold;
    color: rgb(255, 255, 255);
    padding: 5px 3px;
}

table.cinfoT td {
    border: 1px solid rgb(204, 204, 204);
    color: rgb(0, 0, 0);
    padding: 3px;
}

table.cinfoT tr:nth-child(2n+1) {
    background-color: rgb(238, 238, 238);
}

table.cinfoT tr:nth-child(2n) {
    background-color: rgb(255, 255, 255);
}

table.cinfoTS td.cinfoHd {
    font-size: 13px;
}

table.cinfoTS td.cinfoHdL {
    font-size: 13px;
}

table.cinfoTS td {
    font-size: 13px;
    padding: 3px 1px;
}

/* 100%复制ym源码的精确对齐属性 */
table.cinfoT tr[align="right"] td {
    text-align: right;
}

table.cinfoT tr[align="center"] td {
    text-align: center;
}

table.cinfoT td[align="right"] {
    text-align: right;
}

table.cinfoT td[align="center"] {
    text-align: center;
}

table.cinfoT td[valign="bottom"] {
    vertical-align: bottom;
}

/* 100%复制ym源码的bgcolor属性支持 */
table.cinfoT tr[bgcolor="#dddddd"] {
    background-color: #dddddd !important;
}

table.cinfoT tr[bgcolor="#E0F0FE"] {
    background-color: #E0F0FE !important;
}

/* 首页特殊样式 */
.calculator-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calc-category {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
}

.calc-category h3 {
    margin: 0 0 15px 0;
    color: #336699;
    font-size: 18px;
    border-bottom: 2px solid #336699;
    padding-bottom: 5px;
}

.calc-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-link {
    display: block;
    padding: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
}

.calc-link:hover {
    background: #f0f8ff;
    border-color: #336699;
    transform: translateX(5px);
}

.calc-link strong {
    display: block;
    color: #336699;
    font-size: 14px;
    margin-bottom: 3px;
}

.calc-link span {
    display: block;
    color: #666;
    font-size: 12px;
    line-height: 1.3;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .calculator-grid {
        gap: 15px;
    }

    .calc-category {
        padding: 10px;
    }

    .calc-category h3 {
        font-size: 16px;
    }

    .calc-link {
        padding: 8px;
    }

    .calc-link:hover {
        transform: none;
    }
}

/* 特殊表格样式 - 参考ym源码的年度计划表 */
table[cellpadding="3"] {
    border-collapse: collapse;
    border-spacing: 0;
    margin: 15px 0;
    width: 100%;
}

table[cellpadding="3"] tr[bgcolor="#E0F0FE"] {
    background-color: #E0F0FE !important;
    font-weight: bold;
    text-align: center;
}

table[cellpadding="3"] tr[bgcolor="#E0F0FE"] td {
    border: 1px solid #114477;
    background-color: #E0F0FE;
    font-weight: bold;
    color: #000;
    padding: 5px 8px;
    text-align: center;
}

table[cellpadding="3"] tr[bgcolor="#dddddd"] {
    background-color: #dddddd !important;
}

table[cellpadding="3"] tr[bgcolor="#dddddd"] td {
    border: 1px solid #cccccc;
    background-color: #dddddd;
    color: #000;
    padding: 5px 8px;
}

table[cellpadding="3"] tr:not([bgcolor]) td {
    border: 1px solid #cccccc;
    background-color: white;
    color: #000;
    padding: 5px 8px;
}

/* 表单样式 */
fieldset {
    border: 1px solid #bbbbbb;
    padding: 15px;
    margin: 10px 0;
    border-radius: 3px;
}

legend {
    font-weight: bold;
    padding: 0 10px;
    color: #0d233a;
}

/* 输入框样式 - 完全参考ym的输入框设计 */
.inhalf {
    width: 110px;
    padding: 4px 6px;
    border: 1px solid #044284;
    border-radius: 2px;
    box-shadow: #666 1px 1px 2px;
    font-size: 16px;
    background-color: #fff;
}

.indollar {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15px' height='20px'><text x='2' y='15' style='font: normal 16px arial;'>€</text></svg>");
    background-position: left center;
    background-repeat: no-repeat;
    padding-left: 18px !important;
    text-align: right;
}

.inpct {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='17px' height='20px'><text x='1' y='15' style='font: normal 16px arial;'>%</text></svg>");
    background-position: right center;
    background-repeat: no-repeat;
    padding-right: 18px !important;
    text-align: right;
}

.inpct {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='17px' height='20px'><text x='1' y='15' style='font: normal 16px arial;'>%</text></svg>");
    background-position: right center;
    background-repeat: no-repeat;
    padding-right: 18px !important;
    text-align: right;
}

.inlongest {
    width: 200px;
    padding: 4px 6px;
    border: 1px solid #999;
    font-size: 13px;
    border-radius: 2px;
}

/* 按钮样式 - 完全复制ym源码的按钮设计 */
input[type="submit"] {
    border: 0px;
    color: rgb(255, 255, 255);
    padding: 11px 50px 11px 16px;
    font-size: 16px;
    font-weight: bold;
    background-color: rgb(76, 123, 37);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180px' height='40px'><circle cx='160' cy='20' r='12' fill='white'/><path d='M154 17 L166 17 L160 26Z' fill='rgb(76, 123, 37)'/></svg>");
    background-position: right center;
    background-repeat: no-repeat;
    cursor: pointer;
}

input[type="submit"]:hover {
    background-color: rgb(68, 68, 68);
}

input[type="reset"],
input[type="button"],
button {
    border: 0px;
    color: rgb(255, 255, 255);
    padding: 11px 8px;
    font-size: 16px;
    background: rgb(171, 171, 171);
    cursor: pointer;
}

input[type="reset"]:hover,
input[type="button"]:hover,
button:hover {
    background: rgb(68, 68, 68);
}

#bluebtn {
    background: #336699;
    color: white;
    border: 1px solid #225588;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 3px;
    display: inline-block;
    text-decoration: none;
}

#bluebtn:hover {
    background: #225588;
}

/* 单选按钮样式 - 参考ym源码的radio button设计 */
.cbcontainer {
    display: inline-block;
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.cbcontainer input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.rbmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #eee;
    border-radius: 50%;
    border: 1px solid #999;
}

.cbcontainer:hover input ~ .rbmark {
    background-color: #ccc;
}

.cbcontainer input:checked ~ .rbmark {
    background-color: #336699;
}

.rbmark:after {
    content: "";
    position: absolute;
    display: none;
}

.cbcontainer input:checked ~ .rbmark:after {
    display: block;
}

.cbcontainer .rbmark:after {
    top: 5px;
    left: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* 工具提示图标 */
.ttimg {
    margin-left: 5px;
    vertical-align: middle;
    cursor: help;
}

/* 搜索框样式 */
#searchbox {
    width: 100%;
    margin: 15px 0;
}

#searchbox td {
    padding: 2px;
}

#calcSearchOut {
    margin-top: 5px;
}

/* 其他计算器链接 */
#othercalc {
    margin: 15px 0;
}

#octitle {
    background: #336699;
    color: white;
    padding: 8px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
}

#occontent {
    background: #f0f0f0;
    border: 1px solid #bbbbbb;
    border-top: none;
    padding: 10px;
}

#occontent a {
    display: block;
    color: #336699;
    text-decoration: none;
    padding: 3px 0;
    font-size: 13px;
}

#occontent a:hover {
    text-decoration: underline;
    background: #e0e0e0;
    padding-left: 5px;
}

/* 页脚 */
#footer {
    background: #336699;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
}

#footerin {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

#footernav {
    margin-top: 10px;
    font-size: 12px;
}

#footernav a {
    color: white;
    text-decoration: none;
    margin: 0 5px;
}

#footernav a:hover {
    text-decoration: underline;
}

/* 顶部导航 - 绝对定位 */
.topNavAbs {
    position: fixed;
    top: 0;
    right: 20px;
    z-index: 1000;
    background: rgba(51, 102, 153, 0.9);
    padding: 5px;
    border-radius: 0 0 5px 5px;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.nav-link:hover,
.topNavOn {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* 响应式设计 - 手机端优化 */
@media (max-width: 768px) {
    #contentout {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }

    #content {
        padding-right: 0;
    }

    #right {
        width: 100%;
    }

    .inhalf {
        width: 100px;
    }

    .inlongest {
        width: 100%;
    }

    table.cinfoT {
        font-size: 12px;
    }

    table.cinfoT th,
    table.cinfoT td {
        padding: 3px 4px;
    }

    .topNavAbs {
        position: static;
        width: 100%;
        text-align: center;
        border-radius: 0;
        margin-bottom: 10px;
    }

    .panel,
    .leftinput {
        padding: 10px;
    }

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    #header {
        padding: 5px 10px;
        font-size: 12px;
    }

    #contentout {
        padding: 5px;
    }

    .inhalf {
        width: 80px;
        font-size: 12px;
    }

    input[type="submit"],
    input[type="button"],
    button {
        padding: 4px 8px;
        font-size: 12px;
    }

    table.cinfoT {
        font-size: 11px;
    }

    table.cinfoT th,
    table.cinfoT td {
        padding: 2px 3px;
    }
}

/* ym源码的响应式布局规则 - 完全复制 */
@media (max-width: 990px) {
    .leftinput, .clefthalf, .crighthalf {
        width: 310px;
    }
    .rightresult {
        width: 320px;
    }
}

@media (max-width: 720px) {
    #header {
        width: auto;
        padding: 0px 8px;
    }
    #contentout {
        width: auto;
        padding: 8px;
        display: block;
    }
    #content {
        float: none;
        width: auto;
        padding: 0px;
    }
}

@media (max-width: 650px) {
    .leftinput, .rightresult, .clefthalf, .crighthalf {
        width: auto;
        float: none;
    }
}

/* 清除浮动 */
.clear,
#clear {
    clear: both;
}

/* 链接样式 */
a {
    color: #336699;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 列表样式 */
ul, ol {
    margin: 10px 0;
    padding-left: 25px;
}

li {
    margin: 5px 0;
}

/* 段落样式 */
p {
    margin: 10px 0;
    line-height: 1.5;
}

/* 强调文本 */
strong, b {
    font-weight: bold;
}

/* 小文本 */
small {
    font-size: 12px;
    color: #666;
}
